Skip to content

Commit 04e9279

Browse files
committed
[asan][win] Fix ExitThread leak
1 parent dd59198 commit 04e9279

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler-rt/lib/asan/asan_win.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,9 +143,11 @@ static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) {
143143

144144
ThreadStartParams params;
145145
t->GetStartData(params);
146+
// The ExitThread will end the current thread, causing destroy to be unable to
147+
// be called.
148+
t->Destroy();
146149

147150
auto res = (*params.start_routine)(params.arg);
148-
t->Destroy(); // POSIX calls this from TSD destructor.
149151
return res;
150152
}
151153

0 commit comments

Comments
 (0)