summaryrefslogtreecommitdiff
path: root/lib/VMCore
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2012-10-17 23:54:19 +0000
committerBill Wendling <isanbard@gmail.com>2012-10-17 23:54:19 +0000
commit73f75cf2007c3271b2d551c399a78689030c95eb (patch)
tree1b6d79eb71a97bed6d5dc21c6356d12cdd064613 /lib/VMCore
parent07edaf3801f7169477bab6d33cad86209ea8f558 (diff)
downloadllvm-73f75cf2007c3271b2d551c399a78689030c95eb.tar.gz
llvm-73f75cf2007c3271b2d551c399a78689030c95eb.tar.bz2
llvm-73f75cf2007c3271b2d551c399a78689030c95eb.tar.xz
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
Diffstat (limited to 'lib/VMCore')
-rw-r--r--lib/VMCore/Verifier.cpp4
1 files changed, 3 insertions, 1 deletions
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<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 =