aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2010-07-24 23:00:26 +0000
committerEli Friedman <eli.friedman@gmail.com>2010-07-24 23:00:26 +0000
commit568463b556a8e60445f76f14965cddaa15ad484b (patch)
treed174e1f1bac39135fc50917e2435daf5809601f3
parent327f4e4ab2acdc0594581825b0d0a4dca45e8acc (diff)
Make the ll parser check that arguments have valid types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109361 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AsmParser/LLParser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 61b1ae5e97..19e51e32cb 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -3710,8 +3710,12 @@ bool LLParser::ParseCall(Instruction *&Inst, PerFunctionState &PFS,
!(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");