diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2010-07-24 23:00:26 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2010-07-24 23:00:26 +0000 |
| commit | 261c211089b1183a4393c9564d647f13260fe113 (patch) | |
| tree | 516d8770b7278f6468592fea843cda86c2ba46e5 /llvm/lib/AsmParser | |
| parent | 5f6112450fa643bd3c930b83d6ac1acfa7dda429 (diff) | |
| download | bcm5719-llvm-261c211089b1183a4393c9564d647f13260fe113.tar.gz bcm5719-llvm-261c211089b1183a4393c9564d647f13260fe113.zip | |
Make the ll parser check that arguments have valid types.
llvm-svn: 109361
Diffstat (limited to 'llvm/lib/AsmParser')
| -rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 61b1ae5e97c..19e51e32cb9 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/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"); |

