From: Duncan Sands Date: Tue, 27 Sep 2011 16:43:19 +0000 (+0000) Subject: Have the verifier check that all landingpad operands are constants. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=00418ea91c6d9a681fe33182a3bf669e4347f7d2;p=oota-llvm.git 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 --- 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); }