]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
accel/tcg: Don't use TARGET_LONG_BITS in decode_sleb128
authorRichard Henderson <richard.henderson@linaro.org>
Wed, 30 Apr 2025 21:35:47 +0000 (14:35 -0700)
committerRichard Henderson <richard.henderson@linaro.org>
Thu, 1 May 2025 14:37:24 +0000 (07:37 -0700)
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 <pierrick.bouvier@linaro.org>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
accel/tcg/translate-all.c

index fa4998b341b86a1dc8db379100933fffc41fa877..acf32e6c08f039e1d15e65e43744dc3395d22189 100644 (file)
@@ -109,7 +109,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;
     }