From: Bill Wendling Date: Wed, 17 Oct 2012 23:54:19 +0000 (+0000) Subject: Check that the operand of the GEP is not the GEP itself. This occurred during an... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=73f75cf2007c3271b2d551c399a78689030c95eb;p=oota-llvm.git Check that the operand of the GEP is not the GEP itself. This occurred during an LTO build of LLVM. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166157 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index fd629b485aa..88ad5b11cbe 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1371,9 +1371,11 @@ void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) { Type *TargetTy = GEP.getPointerOperandType()->getScalarType(); Assert1(isa(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(TargetTy)->getElementType()->isSized(), "GEP into unsized type!", &GEP); + Assert1(GEP.getPointerOperand() != &GEP, + "GEP is using the result as the pointer operand!", &GEP); SmallVector Idxs(GEP.idx_begin(), GEP.idx_end()); Type *ElTy =