[llvm-commits] [llvm] r101670 - in /llvm/trunk: lib/AsmParser/LLParser.cpp test/Bitcode/memcpy.ll
Chris Lattner
sabre at nondot.org
Sat Apr 17 13:45:56 PDT 2010
Author: lattner
Date: Sat Apr 17 15:45:56 2010
New Revision: 101670
URL: http://llvm.org/viewvc/llvm-project?rev=101670&view=rev
Log:
reject forward references to functions whose type don't match
up with the definition (and fix a broken testcase). PR6491.
Modified:
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/test/Bitcode/memcpy.ll
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=101670&r1=101669&r2=101670&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Sat Apr 17 15:45:56 2010
@@ -2787,6 +2787,10 @@
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
Modified: llvm/trunk/test/Bitcode/memcpy.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Bitcode/memcpy.ll?rev=101670&r1=101669&r2=101670&view=diff
==============================================================================
--- llvm/trunk/test/Bitcode/memcpy.ll (original)
+++ llvm/trunk/test/Bitcode/memcpy.ll Sat Apr 17 15:45:56 2010
@@ -20,4 +20,4 @@
declare void @llvm.memmove.i32(i8*, i8*, i32, i32)
-declare void @llvm.memmove.i64(i8*, i8*, i32, i32)
+declare void @llvm.memmove.i64(i8*, i8*, i64, i32)
More information about the llvm-commits
mailing list