Skip to content

Commit a5b06ad

Browse files
committed
Partially revert "[NFC][msan] Split ThreadStart and Init"
I don't know if removing "if (!start_routine_)" from ThreadStart is NFC. This reverts commit b3267bb.
1 parent 6cad45d commit a5b06ad

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

compiler-rt/lib/msan/msan_thread.cpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,18 @@ void MsanThread::Destroy() {
6565
DTLS_Destroy();
6666
}
6767

68-
thread_return_t MsanThread::ThreadStart() { return start_routine_(arg_); }
68+
thread_return_t MsanThread::ThreadStart() {
69+
if (!start_routine_) {
70+
// start_routine_ == 0 if we're on the main thread or on one of the
71+
// OS X libdispatch worker threads. But nobody is supposed to call
72+
// ThreadStart() for the worker threads.
73+
return 0;
74+
}
75+
76+
thread_return_t res = start_routine_(arg_);
77+
78+
return res;
79+
}
6980

7081
MsanThread::StackBounds MsanThread::GetStackBounds() const {
7182
if (!stack_switching_)

0 commit comments

Comments
 (0)