llvm.org GIT mirror llvm / eedff31
Revert the change from r51157 in test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect. Instead, fix getIndexedType to not follow pointer types, as PointerType is a subclass of CompositeType. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51171 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 12 years ago
2 changed file(s) with 4 addition(s) and 4 deletion(s). Raw diff Collapse all Expand all
13351335 unsigned CurIdx = 0;
13361336 for (; CurIdx != NumIdx; ++CurIdx) {
13371337 const CompositeType *CT = dyn_cast(Agg);
1338 if (!CT) return 0;
1338 if (!CT || isa(CT)) return 0;
13391339 Value *Index = Idxs[CurIdx];
13401340 if (!CT->indexValid(Index)) return 0;
13411341 Agg = CT->getTypeAtIndex(Index);
None ; RUN: llvm-as < %s
0 ; RUN: not llvm-as < %s |& grep {Invalid getelementptr indices}
11
2 ; This testcase was previously considered invalid for indexing into a pointer
3 ; that is contained WITHIN a structure, but this is now valid.
2 ; This testcase is invalid because we are indexing into a pointer that is
3 ; contained WITHIN a structure.
44
55 define void @test({i32, i32*} * %X) {
66 getelementptr {i32, i32*} * %X, i32 0, i32 1, i32 0