From 73f75cf2007c3271b2d551c399a78689030c95eb Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Wed, 17 Oct 2012 23:54:19 +0000 Subject: 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 --- lib/VMCore/Verifier.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/VMCore') diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index fd629b485a..88ad5b11cb 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 = -- cgit v1.2.3