diff options
author | Evan Cheng <evan.cheng@apple.com> | 2008-04-16 01:22:28 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2008-04-16 01:22:28 +0000 |
commit | d94950c47382ba1f1de20fa45aac2a294d05908d (patch) | |
tree | 19b892d79c650f580acd4f1cf687494c9b7ef182 /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 302cd54299f09bc9c8f600df4be142e687acc924 (diff) |
Avoid read after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 4ea1ae7e10..cac10c4e0b 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -553,7 +553,6 @@ static void removeRange(LiveInterval &li, unsigned Start, unsigned End, static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_, const TargetRegisterInfo *tri_) { if (li.empty()) { - li_->removeInterval(li.reg); if (TargetRegisterInfo::isPhysicalRegister(li.reg)) for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) { if (!li_->hasInterval(*SR)) @@ -562,6 +561,7 @@ static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_, if (sli.empty()) li_->removeInterval(*SR); } + li_->removeInterval(li.reg); } } |