diff options
author | Chris Lattner <sabre@nondot.org> | 2009-11-26 22:48:23 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-11-26 22:48:23 +0000 |
commit | 5bda3792b44c8f5e1f9b974a18eb6061c3d27f89 (patch) | |
tree | c0bb78c70ed5e66de747291bd5e35beafccf227a /lib/AsmParser/LLParser.cpp | |
parent | 998e25a1435befc650d05dc4573ca58883d3fac8 (diff) |
Add a hack for PR5601, a crash on obsolete syntax that we plan to
remove in LLVM 3.0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89973 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser/LLParser.cpp')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index 26b6a09ab1..a92dbf82a0 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -2701,6 +2701,10 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) { // 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; |