1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Fixup for r217830. Don't do left shifts on negative values

llvm-svn: 217974
This commit is contained in:
Alexey Samsonov 2014-09-17 18:23:07 +00:00
parent 25e83f310a
commit 6112c3785b

View File

@ -103,7 +103,7 @@ inline int64_t decodeSLEB128(const uint8_t *p, unsigned *n = nullptr) {
} while (Byte >= 128); } while (Byte >= 128);
// Sign extend negative numbers. // Sign extend negative numbers.
if (Byte & 0x40) if (Byte & 0x40)
Value |= (-1LL) << Shift; Value |= (-1ULL) << Shift;
if (n) if (n)
*n = (unsigned)(p - orig_p); *n = (unsigned)(p - orig_p);
return Value; return Value;