mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-16 00:33:10 +00:00
And fix my fix to sink down through the type at the right time. My
original fix would actually trigger the *exact* same crasher as the original bug for a different reason. Awesomesauce. Working on test cases now, but wanted to get bots healthier. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209860 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e4b37ec73a
commit
c62ba58063
@ -1240,14 +1240,6 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
||||
if (Op1->getOperand(J)->getType() != Op2->getOperand(J)->getType())
|
||||
return nullptr;
|
||||
|
||||
if (J > 1) {
|
||||
if (CompositeType *CT = dyn_cast<CompositeType>(CurTy)) {
|
||||
CurTy = CT->getTypeAtIndex(Op1->getOperand(J));
|
||||
} else {
|
||||
CurTy = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
if (Op1->getOperand(J) != Op2->getOperand(J)) {
|
||||
if (DI == -1) {
|
||||
// We have not seen any differences yet in the GEPs feeding the
|
||||
@ -1270,6 +1262,15 @@ Instruction *InstCombiner::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
// Sink down a layer of the type for the next iteration.
|
||||
if (J > 0) {
|
||||
if (CompositeType *CT = dyn_cast<CompositeType>(CurTy)) {
|
||||
CurTy = CT->getTypeAtIndex(Op1->getOperand(J));
|
||||
} else {
|
||||
CurTy = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user