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

Eli Friedman eli.friedman at gmail.com
Sat Jul 24 16:00:27 PDT 2010


Author: efriedma
Date: Sat Jul 24 18:00:26 2010
New Revision: 109361

URL: http://llvm.org/viewvc/llvm-project?rev=109361&view=rev
Log:
Make the ll parser check that arguments have valid types.


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=109361&r1=109360&r2=109361&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Sat Jul 24 18:00:26 2010
@@ -3710,8 +3710,12 @@
       !(Ty = dyn_cast<FunctionType>(PFTy->getElementType()))) {
     // Pull out the types of all of the arguments...
     std::vector<const Type*> ParamTypes;
-    for (unsigned i = 0, e = ArgList.size(); i != e; ++i)
+    for (unsigned i = 0, e = ArgList.size(); i != e; ++i) {
+      const Type* ArgTy = ArgList[i].V->getType();
+      if (!FunctionType::isValidArgumentType(ArgTy))
+        return Error(ArgList[i].Loc, "Invalid argument type for LLVM function");
       ParamTypes.push_back(ArgList[i].V->getType());
+    }
 
     if (!FunctionType::isValidReturnType(RetType))
       return Error(RetTypeLoc, "Invalid result type for LLVM function");





More information about the llvm-commits mailing list