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

Bill Wendling isanbard at gmail.com
Wed Oct 17 16:54:19 PDT 2012


Author: void
Date: Wed Oct 17 18:54:19 2012
New Revision: 166157

URL: http://llvm.org/viewvc/llvm-project?rev=166157&view=rev
Log:
Check that the operand of the GEP is not the GEP itself. This occurred during an LTO build of LLVM.

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=166157&r1=166156&r2=166157&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Wed Oct 17 18:54:19 2012
@@ -1371,9 +1371,11 @@
   Type *TargetTy = GEP.getPointerOperandType()->getScalarType();
 
   Assert1(isa<PointerType>(TargetTy),
-    "GEP base pointer is not a vector or a vector of pointers", &GEP);
+          "GEP base pointer is not a vector or a vector of pointers", &GEP);
   Assert1(cast<PointerType>(TargetTy)->getElementType()->isSized(),
           "GEP into unsized type!", &GEP);
+  Assert1(GEP.getPointerOperand() != &GEP,
+          "GEP is using the result as the pointer operand!", &GEP);
 
   SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end());
   Type *ElTy =





More information about the llvm-commits mailing list