From fb55b7b99d81aa8a3b5be2fd45487fd71b297637 Mon Sep 17 00:00:00 2001 From: Reid Spencer Date: Sun, 25 Feb 2007 23:54:00 +0000 Subject: Fix sext operation. Shifting by zero would leave an incorrect mask. llvm-svn: 34617 --- llvm/lib/Support/APInt.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'llvm/lib/Support') 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; -- cgit v1.2.3