[llvm-commits] CVS: llvm/lib/Support/APInt.cpp

Reid Spencer reid at x10sys.com
Sun Feb 25 15:54:16 PST 2007



Changes in directory llvm/lib/Support:

APInt.cpp updated: 1.43 -> 1.44
---
Log message:

Fix sext operation. Shifting by zero would leave an incorrect mask.


---
Diffs of the changes:  (+1 -1)

 APInt.cpp |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Support/APInt.cpp
diff -u llvm/lib/Support/APInt.cpp:1.43 llvm/lib/Support/APInt.cpp:1.44
--- llvm/lib/Support/APInt.cpp:1.43	Sun Feb 25 17:44:53 2007
+++ llvm/lib/Support/APInt.cpp	Sun Feb 25 17:54:00 2007
@@ -889,7 +889,7 @@
     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;






More information about the llvm-commits mailing list