Avoid read after free.

llvm-svn: 49760
This commit is contained in:
Evan Cheng 2008-04-16 01:22:28 +00:00
parent 3dd8ba6235
commit e29e9774a4
1 changed files with 1 additions and 1 deletions

View File

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