From 3e5d1d8d0839e98ee203aa3e3c4fe84ef71eba2c Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 20 Apr 2008 19:59:12 +0000 Subject: [PATCH] hopefully resolve PR2240 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49999 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/VMCore/ConstantFold.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 50fbe1a00c4..9f31bcdb75f 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -571,7 +571,7 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, if (GVAlign > 1) { unsigned DstWidth = CI2->getType()->getBitWidth(); - unsigned SrcWidth = std::min(SrcWidth, Log2_32(GVAlign)); + unsigned SrcWidth = std::min(DstWidth, Log2_32(GVAlign)); APInt BitsNotSet(APInt::getLowBitsSet(DstWidth, SrcWidth)); // If checking bits we know are clear, return zero.