summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitfb55b7b99d81aa8a3b5be2fd45487fd71b297637 (patch)
tree9215508b1cc09b825126a6f83a51338621144164 /llvm/lib/Support/APInt.cpp
parentb6b5cc3e2fa02dc698e27f2b1a1d2b666e99e4ef (diff)
downloadbcm5719-llvm-fb55b7b99d81aa8a3b5be2fd45487fd71b297637.tar.gz
bcm5719-llvm-fb55b7b99d81aa8a3b5be2fd45487fd71b297637.zip
Fix sext operation. Shifting by zero would leave an incorrect mask.
llvm-svn: 34617
Diffstat (limited to 'llvm/lib/Support/APInt.cpp')
-rw-r--r--llvm/lib/Support/APInt.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 09a600ffa2c..e13778609bb 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud