mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2026-01-31 01:35:20 +01: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. llvm-svn: 266008
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user