diff options
| author | Kuba Brecka <kuba.brecka@gmail.com> | 2015-11-13 20:45:27 +0000 |
|---|---|---|
| committer | Kuba Brecka <kuba.brecka@gmail.com> | 2015-11-13 20:45:27 +0000 |
| commit | 7291b88e9ad07a14ce6ff9db11ab04a887e74482 (patch) | |
| tree | d72d2b4356456b50c59d3a1c6519dbe946c01275 /compiler-rt/lib | |
| parent | d07e069d79ce0c1d08d527739cf468b777e9845b (diff) | |
| download | bcm5719-llvm-7291b88e9ad07a14ce6ff9db11ab04a887e74482.tar.gz bcm5719-llvm-7291b88e9ad07a14ce6ff9db11ab04a887e74482.zip | |
[tsan] Fix finalization of detached threads on OS X
Currently, we crash on finalization of detached threads, because we'll try to clear the ThreadState twice.
Differential Revision: http://reviews.llvm.org/D14644
llvm-svn: 253079
Diffstat (limited to 'compiler-rt/lib')
| -rw-r--r-- | compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc index 5a8950a08cb..7c224bcdcfd 100644 --- a/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc +++ b/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc @@ -139,7 +139,7 @@ static void my_pthread_introspection_hook(unsigned int event, pthread_t thread, } } else if (event == PTHREAD_INTROSPECTION_THREAD_DESTROY) { ThreadState *thr = cur_thread(); - if (thr->tctx->parent_tid == kInvalidTid) { + if (thr->tctx && thr->tctx->parent_tid == kInvalidTid) { DestroyThreadState(); } } |

