mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-03-06 19:37:56 +00:00
Make the ll parser check that arguments have valid types.
llvm-svn: 109361
This commit is contained in:
parent
6769a5186d
commit
124f0f9120
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user