summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/PostRASchedulerList.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-10-02 15:59:52 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-10-02 15:59:52 +0000
commit3b008a3a65d2e66362e2391d29290a8f4707d32a (patch)
treea8c28ad1041cea18123e9461f8f98d526710563a /llvm/lib/CodeGen/PostRASchedulerList.cpp
parentd8e06611ebcd43277a443e110f75a8b855366db8 (diff)
downloadbcm5719-llvm-3b008a3a65d2e66362e2391d29290a8f4707d32a.tar.gz
bcm5719-llvm-3b008a3a65d2e66362e2391d29290a8f4707d32a.zip
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
Diffstat (limited to 'llvm/lib/CodeGen/PostRASchedulerList.cpp')
-rw-r--r--llvm/lib/CodeGen/PostRASchedulerList.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/PostRASchedulerList.cpp b/llvm/lib/CodeGen/PostRASchedulerList.cpp
index 902f50517c5..662ab01a37c 100644
--- a/llvm/lib/CodeGen/PostRASchedulerList.cpp
+++ b/llvm/lib/CodeGen/PostRASchedulerList.cpp
@@ -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;
}
OpenPOWER on IntegriCloud