diff options
Diffstat (limited to 'lib/ExecutionEngine/ExecutionEngine.cpp')
-rw-r--r-- | lib/ExecutionEngine/ExecutionEngine.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/lib/ExecutionEngine/ExecutionEngine.cpp b/lib/ExecutionEngine/ExecutionEngine.cpp index 771ce0b1aa..93207cc8bd 100644 --- a/lib/ExecutionEngine/ExecutionEngine.cpp +++ b/lib/ExecutionEngine/ExecutionEngine.cpp @@ -456,9 +456,7 @@ void ExecutionEngine::StoreValueToMemory(GenericValue Val, GenericValue *Ptr, switch (Ty->getTypeID()) { case Type::IntegerTyID: { unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth(); - uint64_t BitMask = (1ull << BitWidth) - 1; - if (BitWidth >= 64) - BitMask = (uint64_t)-1; + uint64_t BitMask = cast<IntegerType>(Ty)->getBitMask(); GenericValue TmpVal = Val; if (BitWidth <= 8) Ptr->Untyped[0] = Val.Int8Val & BitMask; @@ -514,9 +512,7 @@ Store4BytesLittleEndian: switch (Ty->getTypeID()) { case Type::IntegerTyID: { unsigned BitWidth = cast<IntegerType>(Ty)->getBitWidth(); - uint64_t BitMask = (1ull << BitWidth) - 1; - if (BitWidth >= 64) - BitMask = (uint64_t)-1; + uint64_t BitMask = cast<IntegerType>(Ty)->getBitMask(); GenericValue TmpVal = Val; if (BitWidth <= 8) Ptr->Untyped[0] = Val.Int8Val & BitMask; |