diff options
author | Daniel Henrique Barboza <dbarboza@ventanamicro.com> | 2025-03-07 09:46:02 -0300 |
---|---|---|
committer | Alistair Francis <alistair.francis@wdc.com> | 2025-03-19 16:37:24 +1000 |
commit | ec6411a5251de3479d44c6e539d0e9596c68909b (patch) | |
tree | 7e7a3697f52401476431e0acd525423267aa5f1f /python/qemu/utils/accel.py | |
parent | 3ea8fb521d6161a64879b6f43fac46b4d80d2e39 (diff) | |
download | qemu-ec6411a5251de3479d44c6e539d0e9596c68909b.zip qemu-ec6411a5251de3479d44c6e539d0e9596c68909b.tar.gz qemu-ec6411a5251de3479d44c6e539d0e9596c68909b.tar.bz2 |
target/riscv/csr.c: fix OVERFLOW_BEFORE_WIDEN in rmw_sctrdepth()
Coverity found the following issue:
>>> CID 1593156: Integer handling issues (OVERFLOW_BEFORE_WIDEN)
>>> Potentially overflowing expression "0x10 << depth" with type
"int" (32 bits, signed) is evaluated using 32-bit arithmetic, and then
used in a context that expects an expression of type "uint64_t" (64
bits, unsigned).
4299 depth = 16 << depth;
Fix it by forcing the expression to be 64 bits wide by using '16ULL'.
Resolves: Coverity CID 1593156
Fixes: c48bd18eae ("target/riscv: Add support for Control Transfer Records extension CSRs.")
Signed-off-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Message-ID: <20250307124602.1905754-1-dbarboza@ventanamicro.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'python/qemu/utils/accel.py')
0 files changed, 0 insertions, 0 deletions