Verify that the operand of a getresult instruction is a
authorChris Lattner <sabre@nondot.org>
Wed, 23 Apr 2008 04:06:15 +0000 (04:06 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 23 Apr 2008 04:06:15 +0000 (04:06 +0000)
call/invoke or undef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50129 91177308-0d34-0410-b5e6-96231b3b80d8

lib/VMCore/Verifier.cpp

index 5b8aa7691beca7055033d1757574e2a72c35d67d..8a1b86f763a27aa2cd691f898e0394eee8f8b46c 100644 (file)
@@ -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<CallInst>(GRI.getAggregateValue()) ||
+          isa<InvokeInst>(GRI.getAggregateValue()) ||
+          isa<UndefValue>(GRI.getAggregateValue()),
+          "GetResultInst operand must be a call/invoke/undef!", &GRI);
+  
   visitInstruction(GRI);
 }