mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
Fix a use-after-free in post-ra-scheduling.
MI->addOperand invalidates references to it's operands, avoid touching the operand after a new one was added. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83249 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e1b691f208
commit
8bff4af612
@ -884,6 +884,7 @@ bool SchedulePostRATDList::ToggleKillFlag(MachineInstr *MI,
|
||||
|
||||
// If any subreg of MO is live, then create an imp-def for that
|
||||
// subreg and keep MO marked as killed.
|
||||
MO.setIsKill(false);
|
||||
bool AllDead = true;
|
||||
const unsigned SuperReg = MO.getReg();
|
||||
for (const unsigned *Subreg = TRI->getSubRegisters(SuperReg);
|
||||
@ -898,7 +899,8 @@ bool SchedulePostRATDList::ToggleKillFlag(MachineInstr *MI,
|
||||
}
|
||||
}
|
||||
|
||||
MO.setIsKill(AllDead);
|
||||
if(AllDead)
|
||||
MO.setIsKill(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user