fix crash in my previous patch
authorNuno Lopes <nunoplopes@sapo.pt>
Thu, 12 Nov 2009 15:10:33 +0000 (15:10 +0000)
committerNuno Lopes <nunoplopes@sapo.pt>
Thu, 12 Nov 2009 15:10:33 +0000 (15:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86987 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/ConstantRange.cpp

index 4593eb9dff9e925a85063a174658ac77ed8c419e..e427f820c44632988ae06fdca171018223f5d726 100644 (file)
@@ -618,7 +618,7 @@ ConstantRange::shl(const ConstantRange &Amount) const {
   APInt max = getUnsignedMax() << Amount.getUnsignedMax();
 
   // there's no overflow!
-  APInt Zeros(sizeof(unsigned)*8, getUnsignedMax().countLeadingZeros());
+  APInt Zeros(getBitWidth(), getUnsignedMax().countLeadingZeros());
   if (Zeros.uge(Amount.getUnsignedMax()))
     return ConstantRange(min, max);