mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
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
This commit is contained in:
@@ -1336,7 +1336,7 @@ const Type* ExtractValueInst::getIndexedType(const Type *Agg,
|
|||||||
unsigned CurIdx = 0;
|
unsigned CurIdx = 0;
|
||||||
for (; CurIdx != NumIdx; ++CurIdx) {
|
for (; CurIdx != NumIdx; ++CurIdx) {
|
||||||
const CompositeType *CT = dyn_cast<CompositeType>(Agg);
|
const CompositeType *CT = dyn_cast<CompositeType>(Agg);
|
||||||
if (!CT) return 0;
|
if (!CT || isa<PointerType>(CT)) return 0;
|
||||||
Value *Index = Idxs[CurIdx];
|
Value *Index = Idxs[CurIdx];
|
||||||
if (!CT->indexValid(Index)) return 0;
|
if (!CT->indexValid(Index)) return 0;
|
||||||
Agg = CT->getTypeAtIndex(Index);
|
Agg = CT->getTypeAtIndex(Index);
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
; RUN: llvm-as < %s
|
; RUN: not llvm-as < %s |& grep {Invalid getelementptr indices}
|
||||||
|
|
||||||
; This testcase was previously considered invalid for indexing into a pointer
|
; This testcase is invalid because we are indexing into a pointer that is
|
||||||
; that is contained WITHIN a structure, but this is now valid.
|
; contained WITHIN a structure.
|
||||||
|
|
||||||
define void @test({i32, i32*} * %X) {
|
define void @test({i32, i32*} * %X) {
|
||||||
getelementptr {i32, i32*} * %X, i32 0, i32 1, i32 0
|
getelementptr {i32, i32*} * %X, i32 0, i32 1, i32 0
|
||||||
|
Reference in New Issue
Block a user