From: Chris Lattner Date: Fri, 29 Jul 2011 20:32:28 +0000 (+0000) Subject: have the verifier catch gep's into opaque struct types. PR10473 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4cea5bae8295c04508d103ad7b4f9f27243074f3;p=oota-llvm.git 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 --- diff --git a/lib/VMCore/Verifier.cpp b/lib/VMCore/Verifier.cpp index 905e9a26233..d405baa630b 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(GEP.getOperand(0)->getType()) + ->getElementType()->isSized(), + "GEP into unsized type!", &GEP); + SmallVector Idxs(GEP.idx_begin(), GEP.idx_end()); Type *ElTy = GetElementPtrInst::getIndexedType(GEP.getOperand(0)->getType(), Idxs);