[llvm-commits] [llvm] r89973 - /llvm/trunk/lib/AsmParser/LLParser.cpp

Chris Lattner sabre at nondot.org
Thu Nov 26 14:48:24 PST 2009


Author: lattner
Date: Thu Nov 26 16:48:23 2009
New Revision: 89973

URL: http://llvm.org/viewvc/llvm-project?rev=89973&view=rev
Log:
Add a hack for PR5601, a crash on obsolete syntax that we plan to
remove in LLVM 3.0

Modified:
    llvm/trunk/lib/AsmParser/LLParser.cpp

Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=89973&r1=89972&r2=89973&view=diff

==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Thu Nov 26 16:48:23 2009
@@ -2701,6 +2701,10 @@
   // Add all of the arguments we parsed to the function.
   Function::arg_iterator ArgIt = Fn->arg_begin();
   for (unsigned i = 0, e = ArgList.size(); i != e; ++i, ++ArgIt) {
+    // If we run out of arguments in the Function prototype, exit early.
+    // FIXME: REMOVE THIS IN LLVM 3.0, this is just for the mismatch case above.
+    if (ArgIt == Fn->arg_end()) break;
+    
     // If the argument has a name, insert it into the argument symbol table.
     if (ArgList[i].Name.empty()) continue;
 





More information about the llvm-commits mailing list