Handle a mismatch between # function args and call site args
llvm-svn: 4696
diff --git a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
index 5c15b50..aa9a6a9 100644
--- a/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
+++ b/llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
@@ -160,7 +160,8 @@
// 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;