diff options
| author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-08 00:29:31 +0000 |
|---|---|---|
| committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-08 00:29:31 +0000 |
| commit | 0690d442ab9ddb78e3d72ba6ec252e48fbd659eb (patch) | |
| tree | e1ed6eb2c406b4189ea44671541dc7215991856c /llvm/lib/ExecutionEngine/Interpreter/Interpreter.h | |
| parent | 709750c3d36ee98b71d90832a916c767b57553a2 (diff) | |
| download | llvm-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.h | 2 |
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) |
