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
This commit is contained in:
Chris Lattner 2011-07-29 20:32:28 +00:00
parent e1cf5902ec
commit 4cea5bae82

View File

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