diff options
author | Chris Lattner <sabre@nondot.org> | 2010-04-20 04:49:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-04-20 04:49:11 +0000 |
commit | f1cfb953375b726f999976924f95fb80db3c1c97 (patch) | |
tree | 0ed69bfa2f1e1ef3e5f5c92b1322b9372b8ecab0 /lib/AsmParser/LLParser.cpp | |
parent | 8b1dbebc1e783fde62d01608d5f3a436c5a1a737 (diff) |
reapply 'reject forward references to functions whose type don't match'
now that the testsuite has been updated.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101866 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 fe8e9c7f07..aa887d2177 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -2787,6 +2787,10 @@ bool LLParser::ParseFunctionHeader(Function *&Fn, bool isDefine) { ForwardRefVals.find(FunctionName); if (FRVI != ForwardRefVals.end()) { Fn = M->getFunction(FunctionName); + if (Fn->getType() != PFT) + return Error(FRVI->second.second, "invalid forward reference to " + "function '" + FunctionName + "' with wrong type!"); + ForwardRefVals.erase(FRVI); } else if ((Fn = M->getFunction(FunctionName))) { // If this function already exists in the symbol table, then it is |