From 0ecc42619f36195ab2a904622821833cdf323e8f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Mon, 11 Nov 2002 21:36:05 +0000 Subject: [PATCH] Handle a mismatch between # function args and call site args git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4696 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Analysis/DataStructure/TopDownClosure.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/Analysis/DataStructure/TopDownClosure.cpp b/lib/Analysis/DataStructure/TopDownClosure.cpp index 5c15b50f13a..aa9a6a94c6c 100644 --- a/lib/Analysis/DataStructure/TopDownClosure.cpp +++ b/lib/Analysis/DataStructure/TopDownClosure.cpp @@ -160,7 +160,8 @@ void TDDataStructures::calculateGraph(Function &F) { // Resolve all of the arguments... Function::aiterator AI = Callee->abegin(); - for (unsigned i = 0, e = NewCS.getNumPtrArgs(); i != e; ++i, ++AI) { + for (unsigned i = 0, e = NewCS.getNumPtrArgs(); + i != e && AI != Callee->aend(); ++i, ++AI) { // Advance the argument iterator to the first pointer argument... while (!DS::isPointerType(AI->getType())) { ++AI; -- 2.34.1