From: Richard Henderson Date: Wed, 30 Apr 2025 21:35:47 +0000 (-0700) Subject: accel/tcg: Don't use TARGET_LONG_BITS in decode_sleb128 X-Git-Tag: v9.2.4~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=83c926daf87b02e95f4d69327883db6d2c5379ed;p=thirdparty%2Fqemu.git accel/tcg: Don't use TARGET_LONG_BITS in decode_sleb128 When we changed decode_sleb128 from target_long to int64_t, we failed to adjust the shift limit. Cc: qemu-stable@nongnu.org Fixes: c9ad8d27caa ("tcg: Widen gen_insn_data to uint64_t") Reviewed-by: Pierrick Bouvier Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson (cherry picked from commit 9401f91b9b0c46886388735b3f2033a9c254895a) Signed-off-by: Michael Tokarev --- diff --git a/accel/tcg/translate-all.c b/accel/tcg/translate-all.c index fdf6d8ac191..8531a27f1e8 100644 --- a/accel/tcg/translate-all.c +++ b/accel/tcg/translate-all.c @@ -105,7 +105,7 @@ static int64_t decode_sleb128(const uint8_t **pp) val |= (int64_t)(byte & 0x7f) << shift; shift += 7; } while (byte & 0x80); - if (shift < TARGET_LONG_BITS && (byte & 0x40)) { + if (shift < 64 && (byte & 0x40)) { val |= -(int64_t)1 << shift; }