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 | 7c2342467dd7261610ec18e7c22b5ab0d878b889 (patch) | |
tree | 36d3d0f374fc80e47fb12f28c457375ac92c8485 /llvm/lib/VMCore/Verifier.cpp | |
parent | 6f3d435c5a7e70c2470121474ae7c0a3f60fdc4f (diff) | |
download | bcm5719-llvm-7c2342467dd7261610ec18e7c22b5ab0d878b889.tar.gz bcm5719-llvm-7c2342467dd7261610ec18e7c22b5ab0d878b889.zip |
Check that the operand of the GEP is not the GEP itself. This occurred during an LTO build of LLVM.
llvm-svn: 166157
Diffstat (limited to 'llvm/lib/VMCore/Verifier.cpp')
-rw-r--r-- | llvm/lib/VMCore/Verifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/VMCore/Verifier.cpp b/llvm/lib/VMCore/Verifier.cpp index fd629b485aa..88ad5b11cbe 100644 --- a/llvm/lib/VMCore/Verifier.cpp +++ b/llvm/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 = |