aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-12 03:56:54 +0000
committerChris Lattner <sabre@nondot.org>2007-12-12 03:56:54 +0000
commit7f135cc802435171ab09ebd6a514db26a122b99a (patch)
tree54083d2d67e2fcf9b2d953baa22607c4da66689e
parent765dff258545f019502023045b471443ff9ef6c4 (diff)
downloadexternal_llvm-7f135cc802435171ab09ebd6a514db26a122b99a.zip
external_llvm-7f135cc802435171ab09ebd6a514db26a122b99a.tar.gz
external_llvm-7f135cc802435171ab09ebd6a514db26a122b99a.tar.bz2
Fix a bug in my previous patch, thanks to Jay Foad for
pointing this out and correcting the patch! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44907 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/ConstantFolding.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Analysis/ConstantFolding.cpp b/lib/Analysis/ConstantFolding.cpp
index ebf2786..a810b0f 100644
--- a/lib/Analysis/ConstantFolding.cpp
+++ b/lib/Analysis/ConstantFolding.cpp
@@ -427,10 +427,10 @@ Constant *llvm::ConstantFoldCompareInstOperands(unsigned Predicate,
// there is a truncation or extension that we aren't modeling.
if ((CE0->getOpcode() == Instruction::IntToPtr &&
CE0->getOperand(0)->getType() == IntPtrTy &&
- CE0->getOperand(1)->getType() == IntPtrTy) ||
+ Ops[1]->getOperand(0)->getType() == IntPtrTy) ||
(CE0->getOpcode() == Instruction::PtrToInt &&
CE0->getType() == IntPtrTy &&
- CE0->getOperand(0)->getType() == CE0->getOperand(1)->getType())) {
+ CE0->getOperand(0)->getType() == Ops[1]->getOperand(0)->getType())) {
Constant *NewOps[] = {
CE0->getOperand(0), cast<ConstantExpr>(Ops[1])->getOperand(0)
};