From 82e9bc2f57c00c200d7227b94891f272462d9292 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 16 Oct 2012 17:10:33 +0000 Subject: [PATCH] Speculative fix the mask constants to be of type uintptr_t. I don't know of any case where the old form was incorrect, but I'm more confident that such cases don't exist in this version. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166031 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/ADT/SmallBitVector.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/llvm/ADT/SmallBitVector.h b/include/llvm/ADT/SmallBitVector.h index fba1d12542a..a9cd54e13b3 100644 --- a/include/llvm/ADT/SmallBitVector.h +++ b/include/llvm/ADT/SmallBitVector.h @@ -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