mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-01 18:04:59 +00:00
Fix a regression in the last patch. When constructing a BitMask, be careful
not to overflow 64-bits and end up with a 0 mask. This caused i64 values to always be stored as 0 with lots of consequential damage to nightly test. llvm-svn: 33335
This commit is contained in:
parent
54dac5f09e
commit
08e261a5f6
@ -457,6 +457,8 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr,
|
||||
case Type::IntegerTyID: {
|
||||
unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
|
||||
uint64_t BitMask = (1ull << BitWidth) - 1;
|
||||
if (BitWidth >= 64)
|
||||
BitMask = (uint64_t)-1;
|
||||
GenericValue TmpVal = Val;
|
||||
if (BitWidth <= 8)
|
||||
Ptr->Untyped[0] = Val.Int8Val & BitMask;
|
||||
@ -513,6 +515,8 @@ Store4BytesLittleEndian:
|
||||
case Type::IntegerTyID: {
|
||||
unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth();
|
||||
uint64_t BitMask = (1ull << BitWidth) - 1;
|
||||
if (BitWidth >= 64)
|
||||
BitMask = (uint64_t)-1;
|
||||
GenericValue TmpVal = Val;
|
||||
if (BitWidth <= 8)
|
||||
Ptr->Untyped[0] = Val.Int8Val & BitMask;
|
||||
|
Loading…
x
Reference in New Issue
Block a user