On Tue, 18 Feb 2025 at 09:00, <z...@altlinux.org> wrote:
>
> From: Denis Sergeev <z...@altlinux.org>
>
> Fix an integer overflow issue caused by a left shift operation (1 << i)
> on an int literal. For i >= 31, this could lead to undefined behavior by
> exceeding the 32-bit range.

The only case here where i >= 31 is exactly i == 31.
QEMU compiles with -fwrapv, so in our dialect of C
a shift left of signed integer 1 into the sign bit
is *not* undefined behaviour.

thanks
-- PMM

Reply via email to