summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2011-09-27 19:34:22 +0000
committerDuncan Sands <baldrick@free.fr>2011-09-27 19:34:22 +0000
commit040bff0bc23bd38ad68b2de8dff8bb41706180e0 (patch)
tree300826bff0a79d38c349c36deb23ee650004d421 /lib/VMCore
parent332850d8ccd54a8e0f610a6976c866b915d247f5 (diff)
downloadllvm-040bff0bc23bd38ad68b2de8dff8bb41706180e0.tar.gz
llvm-040bff0bc23bd38ad68b2de8dff8bb41706180e0.tar.bz2
llvm-040bff0bc23bd38ad68b2de8dff8bb41706180e0.tar.xz
Check that catch clauses have pointer type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Verifier.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp
index 804d9c5d3b..9564b7d71f 100644
--- a/lib/VMCore/Verifier.cpp
+++ b/lib/VMCore/Verifier.cpp
@@ -1455,9 +1455,14 @@ void Verifier::visitLandingPadInst(LandingPadInst &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))
+ if (LPI.isCatch(i)) {
+ Assert1(isa<PointerType>(Clause->getType()),
+ "Catch operand does not have pointer type!", &LPI);
+ } else {
+ Assert1(LPI.isFilter(i), "Clause is neither catch nor filter!", &LPI);
Assert1(isa<ConstantArray>(Clause) || isa<ConstantAggregateZero>(Clause),
- "Filter is not an array of constants!", &LPI);
+ "Filter operand is not an array of constants!", &LPI);
+ }
}
visitInstruction(LPI);