Skip to content

Commit 86b846f

Browse files
rth7680Michael Tokarev
authored andcommitted
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: [email protected] Fixes: c9ad8d2 ("tcg: Widen gen_insn_data to uint64_t") Reviewed-by: Pierrick Bouvier <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Signed-off-by: Richard Henderson <[email protected]> (cherry picked from commit 9401f91) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 8a9a719 commit 86b846f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

accel/tcg/translate-all.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static int64_t decode_sleb128(const uint8_t **pp)
106106
val |= (int64_t)(byte & 0x7f) << shift;
107107
shift += 7;
108108
} while (byte & 0x80);
109-
if (shift < TARGET_LONG_BITS && (byte & 0x40)) {
109+
if (shift < 64 && (byte & 0x40)) {
110110
val |= -(int64_t)1 << shift;
111111
}
112112

0 commit comments

Comments
 (0)