diff options
author | Chris Lattner <sabre@nondot.org> | 2011-07-29 20:32:28 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2011-07-29 20:32:28 +0000 |
commit | 4cea5bae8295c04508d103ad7b4f9f27243074f3 (patch) | |
tree | 4bc181f92257a1fdf0fc1fcfade3f12005d5c5da | |
parent | e1cf5902ec832cecdd5a94b9701930253d410741 (diff) |
have the verifier catch gep's into opaque struct types. PR10473
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136510 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/VMCore/Verifier.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 905e9a2623..d405baa630 100644 --- a/lib/VMCore/Verifier.cpp +++ b/lib/VMCore/Verifier.cpp @@ -1288,6 +1288,10 @@ void Verifier::visitShuffleVectorInst(ShuffleVectorInst &SV) { } void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) { + Assert1(cast<PointerType>(GEP.getOperand(0)->getType()) + ->getElementType()->isSized(), + "GEP into unsized type!", &GEP); + SmallVector<Value*, 16> Idxs(GEP.idx_begin(), GEP.idx_end()); Type *ElTy = GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(), Idxs); |