aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2016-05-18 17:50:13 +0000
committerMarshall Clow <mclow.lists@gmail.com>2016-05-18 17:50:13 +0000
commit3379baeb99a9045bffc0ac9b8e3a5b35c640e707 (patch)
treedaf574765b1dbc9a7085c14cc78996f4f1937726 /llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp
parent32173153a47c19b988079b7edc0e2dba30a024fa (diff)
downloadllvm-3379baeb99a9045bffc0ac9b8e3a5b35c640e707.zip
llvm-3379baeb99a9045bffc0ac9b8e3a5b35c640e707.tar.gz
llvm-3379baeb99a9045bffc0ac9b8e3a5b35c640e707.tar.bz2
Change the control flow in atomic_compare_exchange_strong to avoid a potential deadlock.
When you assign a shared_ptr, the deleter gets called and assigned. In this routine, the assignment happens inside a critical section, which could (potentially) lead to a deadlock, if the deleter did something wonky. Now we swap the old value with an (empty) temporary shared_ptr, and then let the temporary delete the old value when it goes out of scope (after the lock has been released). This should fix PR#27724. Thanks to Hans Boehm for the bug report and the suggested fix. llvm-svn: 269965
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblySubtarget.cpp')
0 files changed, 0 insertions, 0 deletions