forked from OSchip/llvm-project
Fix sext operation. Shifting by zero would leave an incorrect mask.
llvm-svn: 34617
This commit is contained in:
parent
b6b5cc3e2f
commit
fb55b7b99d
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue