Speculative fix the mask constants to be of type uintptr_t. I don't know of any...
authorOwen Anderson <resistor@mac.com>
Tue, 16 Oct 2012 17:10:33 +0000 (17:10 +0000)
committerOwen Anderson <resistor@mac.com>
Tue, 16 Oct 2012 17:10:33 +0000 (17:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166031 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/ADT/SmallBitVector.h

index fba1d12542a104e7f6ec6825575c2ddf76ca389c..a9cd54e13b385daeba133dd5e80c2acea2ceb28b 100644 (file)
@@ -306,8 +306,8 @@ public:
     assert(E <= size() && "Attempted to set out-of-bounds range!");
     if (I == E) return *this;
     if (isSmall()) {
-      uintptr_t EMask = 1 << E;
-      uintptr_t IMask = 1 << I;
+      uintptr_t EMask = ((uintptr_t)1) << E;
+      uintptr_t IMask = ((uintptr_t)1) << I;
       uintptr_t Mask = EMask - IMask;
       setSmallBits(getSmallBits() | Mask);
     } else
@@ -337,8 +337,8 @@ public:
     assert(E <= size() && "Attempted to reset out-of-bounds range!");
     if (I == E) return *this;
     if (isSmall()) {
-      uintptr_t EMask = 1 << E;
-      uintptr_t IMask = 1 << I;
+      uintptr_t EMask = ((uintptr_t)1) << E;
+      uintptr_t IMask = ((uintptr_t)1) << I;
       uintptr_t Mask = EMask - IMask;
       setSmallBits(getSmallBits() & ~Mask);
     } else