Fix an assertion failure
authorChris Lattner <sabre@nondot.org>
Thu, 6 Feb 2003 00:15:08 +0000 (00:15 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 6 Feb 2003 00:15:08 +0000 (00:15 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5496 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index cf117bbd6bb9a951cdd46b29a6814a11f5f510a3..5a5f2177c6a28897035203cc5dd0229b3b1791bc 100644 (file)
@@ -695,14 +695,14 @@ void DSGraph::mergeInGraph(DSCallSite &CS, const DSGraph &Graph,
 
   for (unsigned i = 0, e = CS.getNumPtrArgs(); i != e; ++i, ++AI) {
     // Advance the argument iterator to the first pointer argument...
-    while (!isPointerType(AI->getType())) {
+    while (AI != F.aend() && !isPointerType(AI->getType())) {
       ++AI;
 #ifndef NDEBUG
       if (AI == F.aend())
         std::cerr << "Bad call to Function: " << F.getName() << "\n";
 #endif
-      assert(AI != F.aend() && "# Args provided is not # Args required!");
     }
+    if (AI == F.aend()) break;
     
     // Add the link from the argument scalar to the provided value
     DSNodeHandle &NH = (*ScalarMap)[AI];