mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 05:01:59 +01:00
[Support] Fix overflow in SLEB128 decoding.
decodeULEB128 was fixed in r216268, but decodeSLEB128 always had the same issue, which is now exposed in r301369. llvm-svn: 301510
This commit is contained in:
parent
60b774306e
commit
c840b5c6e8
@ -160,7 +160,7 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr,
|
||||
return 0;
|
||||
}
|
||||
Byte = *p++;
|
||||
Value |= ((Byte & 0x7f) << Shift);
|
||||
Value |= (int64_t(Byte & 0x7f) << Shift);
|
||||
Shift += 7;
|
||||
} while (Byte >= 128);
|
||||
// Sign extend negative numbers.
|
||||
|
Loading…
x
Reference in New Issue
Block a user