projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3b6eaac
)
CodeGen: Fix a use-after-free in TailDuplication
author
Justin Bogner
<mail@justinbogner.com>
Mon, 11 Apr 2016 22:37:13 +0000
(22:37 +0000)
committer
Justin Bogner
<mail@justinbogner.com>
Mon, 11 Apr 2016 22:37:13 +0000
(22:37 +0000)
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
llvm/lib/CodeGen/TailDuplicator.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/CodeGen/TailDuplicator.cpp
b/llvm/lib/CodeGen/TailDuplicator.cpp
index
7929d87
..
1ea15af
100644
(file)
--- 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.