From 75df16a5b01eb73107cae103cd79f5b1ebbcbf9a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 20 Apr 2008 19:59:12 +0000 Subject: [PATCH] hopefully resolve PR2240 llvm-svn: 49999 --- 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.