From 4459145c2ccb5d063841a5d8c76b8b8ac9adaf2f Mon Sep 17 00:00:00 2001 From: Nuno Lopes Date: Thu, 12 Nov 2009 15:10:33 +0000 Subject: [PATCH] fix crash in my previous patch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86987 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Support/ConstantRange.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Support/ConstantRange.cpp b/lib/Support/ConstantRange.cpp index 4593eb9dff9..e427f820c44 100644 --- a/lib/Support/ConstantRange.cpp +++ b/lib/Support/ConstantRange.cpp @@ -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);