[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
This commit is contained in:
Kuba Brecka 2015-11-13 20:45:27 +00:00
parent d07e069d79
commit 7291b88e9a
1 changed files with 1 additions and 1 deletions

View File

@ -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();
}
}