diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-02-25 23:54:00 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-02-25 23:54:00 +0000 |
commit | fb55b7b99d81aa8a3b5be2fd45487fd71b297637 (patch) | |
tree | 9215508b1cc09b825126a6f83a51338621144164 /llvm/lib/Support/APInt.cpp | |
parent | b6b5cc3e2fa02dc698e27f2b1a1d2b666e99e4ef (diff) | |
download | bcm5719-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.cpp | 2 |
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; |