Have the verifier check that all landingpad operands are constants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140606 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands 2011-09-27 16:43:19 +00:00
parent a3c42f3d4e
commit 00418ea91c

View File

@ -1449,6 +1449,17 @@ void Verifier::visitLandingPadInst(LandingPadInst &LPI) {
"Personality function doesn't match others in function", &LPI);
PersonalityFn = LPI.getPersonalityFn();
// All operands must be constants.
Assert1(isa<Constant>(PersonalityFn), "Personality function is not constant!",
&LPI);
for (unsigned i = 0, e = LPI.getNumClauses(); i < e; ++i) {
Value *Clause = LPI.getClause(i);
Assert1(isa<Constant>(Clause), "Clause is not constant!", &LPI);
if (LPI.isFilter(i))
Assert1(isa<ConstantArray>(Clause) || isa<ConstantAggregateZero>(Clause),
"Filter is not an array of constants!", &LPI);
}
visitInstruction(LPI);
}