commit | 23cbb1c78a6de399b318f68577469b0a566b0faa | [log] [tgz] |
---|---|---|
author | Reid Spencer <rspencer@reidspencer.com> | Thu Feb 08 00:29:31 2007 +0000 |
committer | Reid Spencer <rspencer@reidspencer.com> | Thu Feb 08 00:29:31 2007 +0000 |
tree | c31dcc6815834cd53d16888937ea72acab6a4e88 | |
parent | 785a5ae0cf2a13738ba42f6c91fd42397d20c200 [diff] [blame] |
For PR1188: Compute BitMask correctly. Patch by Leo (wenwenti@hotmail.com). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34026 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/ExecutionEngine/Interpreter/Interpreter.h b/lib/ExecutionEngine/Interpreter/Interpreter.h index a8deb01..aef4cb2 100644 --- a/lib/ExecutionEngine/Interpreter/Interpreter.h +++ b/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -236,7 +236,7 @@ }; inline void maskToBitWidth(GenericValue& GV, unsigned BitWidth) { - uint64_t BitMask = (1ull << BitWidth) - 1; + uint64_t BitMask = ~(uint64_t)(0ull) >> (64-BitWidth); if (BitWidth <= 8) GV.Int8Val &= BitMask; else if (BitWidth <= 16)