aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <djg@cray.com>2007-07-20 23:17:34 +0000
committerDan Gohman <djg@cray.com>2007-07-20 23:17:34 +0000
commit2c6a6420d071315104cf3858ce5409b0a45e974b (patch)
tree95cdab551cadecb8363de87970763a4e90d7af8e /include
parentd88b14d7585c5dd2d9253251fb24aa0fa43750f5 (diff)
downloadexternal_llvm-2c6a6420d071315104cf3858ce5409b0a45e974b.zip
external_llvm-2c6a6420d071315104cf3858ce5409b0a45e974b.tar.gz
external_llvm-2c6a6420d071315104cf3858ce5409b0a45e974b.tar.bz2
Don't assume that only Uses can be kills. Defs are marked as kills initially
when there are no uses. This fixes a dangling-pointer bug, where pointers to deleted instructions were not removed from kills lists. More info here: http://lists.cs.uiuc.edu/pipermail/llvmdev/2007-July/009749.html git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/CodeGen/LiveVariables.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/LiveVariables.h b/include/llvm/CodeGen/LiveVariables.h
index ec01556..36b6860 100644
--- a/include/llvm/CodeGen/LiveVariables.h
+++ b/include/llvm/CodeGen/LiveVariables.h
@@ -229,7 +229,7 @@ public:
bool Removed = false;
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
MachineOperand &MO = MI->getOperand(i);
- if (MO.isReg() && MO.isUse() && MO.getReg() == reg) {
+ if (MO.isReg() && MO.isKill() && MO.getReg() == reg) {
MO.unsetIsKill();
Removed = true;
break;