From 00418ea91c6d9a681fe33182a3bf669e4347f7d2 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Tue, 27 Sep 2011 16:43:19 +0000 Subject: [PATCH] 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 --- lib/VMCore/Verifier.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 5936d809835..804d9c5d3b8 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -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(PersonalityFn), "Personality function is not constant!", + &LPI); + for (unsigned i = 0, e = LPI.getNumClauses(); i < e; ++i) { + Value *Clause = LPI.getClause(i); + Assert1(isa(Clause), "Clause is not constant!", &LPI); + if (LPI.isFilter(i)) + Assert1(isa(Clause) || isa(Clause), + "Filter is not an array of constants!", &LPI); + } + visitInstruction(LPI); }