qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [RISC-V] Coverity 1390849, Logically dead code


From: Richard Henderson
Subject: [Qemu-devel] [RISC-V] Coverity 1390849, Logically dead code
Date: Thu, 24 May 2018 14:54:35 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0

In the latest Coverity scan, it reports

405    if (csrno >= CSR_MHPMCOUNTER3 && csrno <= CSR_MHPMCOUNTER31) {
406        return 0;
407    }
408#if defined(TARGET_RISCV32)
409    if (csrno >= CSR_MHPMCOUNTER3 && csrno <= CSR_MHPMCOUNTER31) {
        
CID 1390849 (#1 of 1): Logically dead code (DEADCODE)
dead_error_line: Execution cannot reach this statement: return 0U;.

410        return 0;
411    }
412#endif


I believe the condition at op_helper.c:409 should be testing CSR_MHPMCOUNTER3H
and CSR_MHPMCOUNTER31H.  Must run now, otherwise I'd also send the trivial 
patch.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]