When decoding SLEB128, make sure sign extension is performed for
64-bit integers. MFC after: 3 days
This commit is contained in:
parent
61c2a6184e
commit
3254dc0a2b
@ -192,7 +192,7 @@ dwarf_read_sleb128(Elf_Data **dp, uint64_t *offsetp)
|
||||
shift += 7;
|
||||
} while ((b & 0x80) != 0);
|
||||
|
||||
if (shift < 32 && (b & 0x40) != 0)
|
||||
if (shift < 64 && (b & 0x40) != 0)
|
||||
ret |= (-1 << shift);
|
||||
|
||||
return ret;
|
||||
|
@ -46,7 +46,7 @@ dwarf_decode_sleb128(uint8_t **dp)
|
||||
shift += 7;
|
||||
} while ((b & 0x80) != 0);
|
||||
|
||||
if (shift < 32 && (b & 0x40) != 0)
|
||||
if (shift < 64 && (b & 0x40) != 0)
|
||||
ret |= (-1 << shift);
|
||||
|
||||
*dp = src;
|
||||
|
Loading…
Reference in New Issue
Block a user