qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] target/m68k: avoid shift into sign bit in dump_address_map()


From: Peter Maydell
Subject: Re: [PATCH] target/m68k: avoid shift into sign bit in dump_address_map()
Date: Mon, 29 Jul 2024 16:59:24 +0100

On Tue, 23 Jul 2024 at 16:42, Peter Maydell <peter.maydell@linaro.org> wrote:
>
> Coverity complains (CID 1547592) that in dump_address_map() we take a
> value stored in a signed integer variable 'i' and shift it by enough
> to shift into the sign bit when we construct the value 'logical'.
> This isn't a bug for QEMU because we use -fwrapv semantics, but
> we can make Coverity happy by using an unsigned type for the loop
> variables i, j, k in this function.
>
> While we're changing the declaration of the variables, put them
> in the for() loops so their scope is the minimum required (a style
> now permitted by our coding style guide).
>
> Resolves: Coverity CID 1547592
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> I could have just marked this as a false-positive, but it
> just about seemed worth making the change overall.
> ---

I'll take this via target-arm.next unless you prefer
otherwise, since I'm doing a pullreq anyway.

thanks
-- PMM



reply via email to

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