diff options
author | Bill Wendling <isanbard@gmail.com> | 2012-10-17 23:54:19 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2012-10-17 23:54:19 +0000 |
commit | 73f75cf2007c3271b2d551c399a78689030c95eb (patch) | |
tree | 1b6d79eb71a97bed6d5dc21c6356d12cdd064613 /lib/VMCore | |
parent | 07edaf3801f7169477bab6d33cad86209ea8f558 (diff) | |
download | external_llvm-73f75cf2007c3271b2d551c399a78689030c95eb.zip external_llvm-73f75cf2007c3271b2d551c399a78689030c95eb.tar.gz external_llvm-73f75cf2007c3271b2d551c399a78689030c95eb.tar.bz2 |
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.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index fd629b4..88ad5b1 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 = |