mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-15 04:30:12 +00:00
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:
parent
a3c42f3d4e
commit
00418ea91c
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user