[llvm-commits] [llvm] r136510 - /llvm/trunk/lib/VMCore/Verifier.cpp
Chris Lattner
sabre at nondot.org
Fri Jul 29 13:32:28 PDT 2011
Author: lattner
Date: Fri Jul 29 15:32:28 2011
New Revision: 136510
URL: http://llvm.org/viewvc/llvm-project?rev=136510&view=rev
Log:
have the verifier catch gep's into opaque struct types. PR10473
Modified:
llvm/trunk/lib/VMCore/Verifier.cpp
Modified: llvm/trunk/lib/VMCore/Verifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Verifier.cpp?rev=136510&r1=136509&r2=136510&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Verifier.cpp (original)
+++ llvm/trunk/lib/VMCore/Verifier.cpp Fri Jul 29 15:32:28 2011
@@ -1288,6 +1288,10 @@
}
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);
More information about the llvm-commits
mailing list