From bc7ea01b8a31ecebcd238ce411287b803ba8341a Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 23 Apr 2008 04:06:15 +0000 Subject: [PATCH] Verify that the operand of a getresult instruction is a call/invoke or undef. llvm-svn: 50129 --- lib/VMCore/Verifier.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 5b8aa7691be..8a1b86f763a 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1081,8 +1081,14 @@ void Verifier::visitAllocationInst(AllocationInst &AI) { } void Verifier::visitGetResultInst(GetResultInst &GRI) { - Assert1(GRI.isValidOperands(GRI.getAggregateValue(), GRI.getIndex()), + Assert1(GetResultInst::isValidOperands(GRI.getAggregateValue(), + GRI.getIndex()), "Invalid GetResultInst operands!", &GRI); + Assert1(isa(GRI.getAggregateValue()) || + isa(GRI.getAggregateValue()) || + isa(GRI.getAggregateValue()), + "GetResultInst operand must be a call/invoke/undef!", &GRI); + visitInstruction(GRI); }