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 | e29e9774a404f64e1bfec06148f39e734f77e599 (patch) | |
tree | b6ebedfb88f40f11af7e30820a85030bd645b219 /llvm/lib | |
parent | 3dd8ba6235c06054704587beb3e6d2ba7db17eb8 (diff) | |
download | bcm5719-llvm-e29e9774a404f64e1bfec06148f39e734f77e599.tar.gz bcm5719-llvm-e29e9774a404f64e1bfec06148f39e734f77e599.zip |
Avoid read after free.
llvm-svn: 49760
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp b/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp index 4ea1ae7e10e..cac10c4e0b3 100644 --- a/llvm/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/llvm/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); } } |