mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-01-10 18:11:19 +00:00
[SystemZ] Fix fallout from r288374
Avoid undefined behavior due to too-large shift count. llvm-svn: 288391
This commit is contained in:
parent
cf26d56390
commit
d36b31d03f
@ -101,6 +101,7 @@ void SystemZMCAsmBackend::applyFixup(const MCFixup &Fixup, char *Data,
|
|||||||
|
|
||||||
// Big-endian insertion of Size bytes.
|
// Big-endian insertion of Size bytes.
|
||||||
Value = extractBitsForFixup(Kind, Value);
|
Value = extractBitsForFixup(Kind, Value);
|
||||||
|
if (BitSize < 64)
|
||||||
Value &= ((uint64_t)1 << BitSize) - 1;
|
Value &= ((uint64_t)1 << BitSize) - 1;
|
||||||
unsigned ShiftValue = (Size * 8) - 8;
|
unsigned ShiftValue = (Size * 8) - 8;
|
||||||
for (unsigned I = 0; I != Size; ++I) {
|
for (unsigned I = 0; I != Size; ++I) {
|
||||||
|
Loading…
Reference in New Issue
Block a user