1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02: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.

llvm-svn: 83249
This commit is contained in:
Benjamin Kramer 2009-10-02 15:59:52 +00:00
parent 4480acda62
commit aa33886dd7

View File

@ -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;
}