mirror of
https://github.com/RPCS3/llvm.git
synced 2025-03-04 08:37:45 +00:00
CodeGen: Fix a use-after-free in TailDuplication
The call to processPHI already erased MI from its parent, so MI isn't even valid here, making the getParent() call a use-after-free in addition to being redundant. Found by ASan with the ArrayRecycler changes in llvm.org/pr26808. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@266008 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
eb5d561d4c
commit
b4aa9bf76e
@ -801,8 +801,6 @@ bool TailDuplicator::tailDuplicate(MachineFunction &MF, bool IsSimple,
|
||||
// from PredBB.
|
||||
MachineInstr *MI = &*I++;
|
||||
processPHI(MI, TailBB, PrevBB, LocalVRMap, CopyInfos, UsedByPhi, true);
|
||||
if (MI->getParent())
|
||||
MI->eraseFromParent();
|
||||
}
|
||||
|
||||
// Now copy the non-PHI instructions.
|
||||
|
Loading…
x
Reference in New Issue
Block a user