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);