summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc2
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();
}
}
OpenPOWER on IntegriCloud