]> Git Repo - qemu.git/commit
target/mips: Fix potential integer overflow (CID 1452921)
authorPhilippe Mathieu-Daudé <[email protected]>
Wed, 5 May 2021 21:38:36 +0000 (23:38 +0200)
committerPhilippe Mathieu-Daudé <[email protected]>
Thu, 24 Jun 2021 14:44:14 +0000 (16:44 +0200)
commit2838b1d6356044eb240edd4e1b9b5ab5946c5b28
tree0aa932192f6618fe303f58cef8d552df902c4b6d
parentd0ac9a61474cf594d19082bc8976247e984ea9a3
target/mips: Fix potential integer overflow (CID 1452921)

Use the BIT_ULL() macro to ensure we use 64-bit arithmetic.
This fixes the following Coverity issue (OVERFLOW_BEFORE_WIDEN):

  CID 1452921:  Integer handling issues:

    Potentially overflowing expression "1 << w" 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).

Fixes: 074cfcb4dae ("target/mips: Implement hardware page table walker")
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Reviewed-by: Richard Henderson <[email protected]>
Message-Id: <20210505215119.1517465[email protected]>
target/mips/tcg/sysemu/tlb_helper.c
This page took 0.022663 seconds and 4 git commands to generate.