diff options
author | Justin Bogner <mail@justinbogner.com> | 2016-04-11 22:37:13 +0000 |
---|---|---|
committer | Justin Bogner <mail@justinbogner.com> | 2016-04-11 22:37:13 +0000 |
commit | 1faf01578e07aa54a9d68a8865d001fe9d416cc0 (patch) | |
tree | 8585a8cc387539946430db9a2b61959adc155533 /llvm/lib/CodeGen | |
parent | 3b6eaace6289f5ee9f21e6859d7964fd89760b06 (diff) | |
download | bcm5719-llvm-1faf01578e07aa54a9d68a8865d001fe9d416cc0.tar.gz bcm5719-llvm-1faf01578e07aa54a9d68a8865d001fe9d416cc0.zip |
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
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/TailDuplicator.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/TailDuplicator.cpp b/llvm/lib/CodeGen/TailDuplicator.cpp index 7929d87d880..1ea15afc170 100644 --- a/llvm/lib/CodeGen/TailDuplicator.cpp +++ b/llvm/lib/CodeGen/TailDuplicator.cpp @@ -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. |