diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-22 21:36:45 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2015-01-22 21:36:45 +0000 |
commit | 8d536973a22ef1ad5c4ff1a120633cc028313f57 (patch) | |
tree | d00d040d337f45f0232b955d20d2966b7d3ceab7 /llvm/lib/IR/LLVMContextImpl.h | |
parent | c6ccc4fe91b8f1bc5251b454ac1f6c79a6177c8b (diff) | |
download | bcm5719-llvm-8d536973a22ef1ad5c4ff1a120633cc028313f57.tar.gz bcm5719-llvm-8d536973a22ef1ad5c4ff1a120633cc028313f57.zip |
IR: Update references to temporaries before deleting
During `MDNode::deleteTemporary()`, call `replaceAllUsesWith(nullptr)`
to update all tracking references to `nullptr`.
This fixes PR22280, where inverted destruction order between tracking
references and the temporaries themselves caused a use-after-free in
`LLParser`.
An alternative fix would be to add an assertion that there are no users,
and continue to fix inverted destruction order in clients (like
`LLParser`), but instead I decided to make getting-teardown-right easy.
(If someone disagrees let me know.)
llvm-svn: 226866
Diffstat (limited to 'llvm/lib/IR/LLVMContextImpl.h')
0 files changed, 0 insertions, 0 deletions