On Mon, 16 Mar 2020 at 12:14, Yifei Jiang <jiangyi...@huawei.com> wrote:
>
> This fixes coverity issues 75235919, etc.,
>     1524    /* Handle CPU specific unaligned behaviour */
> CID 75235919: (OVERFLOW_BEFORE_WIDEN)
>     1525. overflow_before_widen: Potentially overflowing expression "1 << 
> a_bits" with type "int" (32 bits, signed) is evaluated using 32-bit 
> arithmetic, and then used in a context that expects an expression of type 
> "target_ulong" (64 bits, unsigned).
>     1525    if (addr & ((1 << a_bits) - 1)) {

This is a Coverity false positive. The value of a_bits in
these cases can never be big enough for 1 << a_bits
to overflow, because it indicates an alignment requirement
and will at most be 6 (indicating a 64-byte-alignment).

thanks
-- PMM

Reply via email to