aboutsummaryrefslogtreecommitdiff
path: root/lib/Support/APInt.cpp
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-02-25 23:54:00 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-02-25 23:54:00 +0000
commitf30b1885aec1e53edf815bf6c58d93b754e52996 (patch)
tree6ce13c397c14aa68f1043b62207993fff74a98c7 /lib/Support/APInt.cpp
parent9eec2413479becc7ccda188b083e43208748923b (diff)
Fix sext operation. Shifting by zero would leave an incorrect mask.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34617 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Support/APInt.cpp')
-rw-r--r--lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Support/APInt.cpp b/lib/Support/APInt.cpp
index 09a600ffa2..e13778609b 100644
--- a/lib/Support/APInt.cpp
+++ b/lib/Support/APInt.cpp
@@ -889,7 +889,7 @@ void APInt::sext(uint32_t width) {
return;
}
- uint64_t mask = ~0ULL << wordBits;
+ uint64_t mask = wordBits == 0 ? 0 : ~0ULL << wordBits;
uint64_t *newVal = getMemory(wordsAfter);
if (wordsBefore == 1)
newVal[0] = VAL | mask;