[llvm-commits] [llvm] r50129 - /llvm/trunk/lib/VMCore/Verifier.cpp

Chris Lattner sabre at nondot.org
Tue Apr 22 21:06:15 PDT 2008


Author: lattner
Date: Tue Apr 22 23:06:15 2008
New Revision: 50129

URL: http://llvm.org/viewvc/llvm-project?rev=50129&view=rev
Log:
Verify that the operand of a getresult instruction is a 
call/invoke or undef.

Modified:
    llvm/trunk/lib/VMCore/Verifier.cpp

Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=50129&r1=50128&r2=50129&view=diff

==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Tue Apr 22 23:06:15 2008
@@ -1081,8 +1081,14 @@
 }
 
 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);
 }
 





More information about the llvm-commits mailing list