From ceda605fd7d0e3532a22743538c6d118fe5e40c1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 17 Nov 2005 19:35:42 +0000 Subject: [PATCH] This was checking the wrong GEP expression. Fixing this fixes a gccas crash compiling mysql reported by Ted Kremenek. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24402 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/IndVarSimplify.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Transforms/Scalar/IndVarSimplify.cpp b/lib/Transforms/Scalar/IndVarSimplify.cpp index f2b812d437d..bf735aff9ea 100644 --- a/lib/Transforms/Scalar/IndVarSimplify.cpp +++ b/lib/Transforms/Scalar/IndVarSimplify.cpp @@ -162,7 +162,7 @@ void IndVarSimplify::EliminatePointerRecurrence(PHINode *PN, if (CE->getOperand(NumOps-1)->isNullValue()) { // Check to make sure the last index really is an array index. gep_type_iterator GTI = gep_type_begin(GEPI); - for (unsigned i = 1, e = GEPI->getNumOperands()-1; + for (unsigned i = 1, e = CE->getNumOperands()-1; i != e; ++i, ++GTI) /*empty*/; if (isa(*GTI)) {