aboutsummaryrefslogtreecommitdiffstats
path: root/lib/AsmParser
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-08-12 20:52:25 +0000
committerBill Wendling <isanbard@gmail.com>2011-08-12 20:52:25 +0000
commit746c882538fb1def27b61f06ce03b320858b1b89 (patch)
treefa84c0255af44020645b7c67af5a9d47689adeaa /lib/AsmParser
parent0d09499cf3e2d927cdc53ec79895303ac12808ac (diff)
downloadexternal_llvm-746c882538fb1def27b61f06ce03b320858b1b89.zip
external_llvm-746c882538fb1def27b61f06ce03b320858b1b89.tar.gz
external_llvm-746c882538fb1def27b61f06ce03b320858b1b89.tar.bz2
Add checks for the landingpad instruction's clause values to make sure that
they're the correct type. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137511 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AsmParser')
-rw-r--r--lib/AsmParser/LLParser.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index 6a4c2a8..a5412a6 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -3554,6 +3554,16 @@ bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) {
return true;
}
+ // A 'catch' type expects a non-array constant. A filter clause expects an
+ // array constant.
+ if (CT == LandingPadInst::Catch) {
+ if (isa<ArrayType>(V->getType()))
+ Error(VLoc, "'catch' clause has an invalid type");
+ } else {
+ if (!isa<ArrayType>(V->getType()))
+ Error(VLoc, "'filter' clause has an invalid type");
+ }
+
LP->addClause(V);
}