1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
llvm-mirror/test/Assembler/invalid-mdnode-badref.ll
Duncan P. N. Exon Smith c7c851bb04 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
2015-01-22 21:36:45 +00:00

6 lines
154 B
LLVM

; RUN: not llvm-as < %s -disable-output 2>&1 | FileCheck %s
!named = !{!0}
; CHECK: [[@LINE+1]]:14: error: use of undefined metadata '!1'
!0 = !{!0, !1}