mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-07-18 12:29:27 +00:00
Avoid read after free.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49760 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
302cd54299
commit
d94950c473
@ -553,7 +553,6 @@ static void removeRange(LiveInterval &li, unsigned Start, unsigned End,
|
|||||||
static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_,
|
static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_,
|
||||||
const TargetRegisterInfo *tri_) {
|
const TargetRegisterInfo *tri_) {
|
||||||
if (li.empty()) {
|
if (li.empty()) {
|
||||||
li_->removeInterval(li.reg);
|
|
||||||
if (TargetRegisterInfo::isPhysicalRegister(li.reg))
|
if (TargetRegisterInfo::isPhysicalRegister(li.reg))
|
||||||
for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) {
|
for (const unsigned* SR = tri_->getSubRegisters(li.reg); *SR; ++SR) {
|
||||||
if (!li_->hasInterval(*SR))
|
if (!li_->hasInterval(*SR))
|
||||||
@ -562,6 +561,7 @@ static void removeIntervalIfEmpty(LiveInterval &li, LiveIntervals *li_,
|
|||||||
if (sli.empty())
|
if (sli.empty())
|
||||||
li_->removeInterval(*SR);
|
li_->removeInterval(*SR);
|
||||||
}
|
}
|
||||||
|
li_->removeInterval(li.reg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user