diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-08-12 20:52:25 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-08-12 20:52:25 +0000 |
commit | a52aa3c18fa65ed65abbd0ea0f91684da2eae210 (patch) | |
tree | cfbd90fda243ebf59d1fe6f71af578c55231b9df | |
parent | 70a315c3630fd19a0ef27a8f7d63f6599c8a3f6b (diff) | |
download | bcm5719-llvm-a52aa3c18fa65ed65abbd0ea0f91684da2eae210.tar.gz bcm5719-llvm-a52aa3c18fa65ed65abbd0ea0f91684da2eae210.zip |
Add checks for the landingpad instruction's clause values to make sure that
they're the correct type.
llvm-svn: 137511
-rw-r--r-- | llvm/lib/AsmParser/LLParser.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp index 6a4c2a8fb93..a5412a6764d 100644 --- a/llvm/lib/AsmParser/LLParser.cpp +++ b/llvm/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); } |