aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-08 00:29:31 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-08 00:29:31 +0000
commit0690d442ab9ddb78e3d72ba6ec252e48fbd659eb (patch)
treee1ed6eb2c406b4189ea44671541dc7215991856c /llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
parent709750c3d36ee98b71d90832a916c767b57553a2 (diff)
downloadllvm-0690d442ab9ddb78e3d72ba6ec252e48fbd659eb.zip
llvm-0690d442ab9ddb78e3d72ba6ec252e48fbd659eb.tar.gz
llvm-0690d442ab9ddb78e3d72ba6ec252e48fbd659eb.tar.bz2
For PR1188:
Compute BitMask correctly. Patch by Leo (wenwenti@hotmail.com). llvm-svn: 34026
Diffstat (limited to 'llvm/lib/ExecutionEngine/Interpreter/Interpreter.h')
-rw-r--r--llvm/lib/ExecutionEngine/Interpreter/Interpreter.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
index a8deb01..aef4cb2 100644
--- a/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
+++ b/llvm/lib/ExecutionEngine/Interpreter/Interpreter.h
@@ -236,7 +236,7 @@ private: // Helper functions
};
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)