mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
Add checks for the landingpad instruction's clause values to make sure that
they're the correct type. llvm-svn: 137511
This commit is contained in:
parent
2ea55a0881
commit
f57d39d13d
@ -3554,6 +3554,16 @@ bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// A 'catch' type expects a non-array constant. A filter clause expects an
|
||||
// array constant.
|
||||
if (CT == LandingPadInst::Catch) {
|
||||
if (isa<ArrayType>(V->getType()))
|
||||
Error(VLoc, "'catch' clause has an invalid type");
|
||||
} else {
|
||||
if (!isa<ArrayType>(V->getType()))
|
||||
Error(VLoc, "'filter' clause has an invalid type");
|
||||
}
|
||||
|
||||
LP->addClause(V);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user