mirror of
https://github.com/intel/llvm.git
synced 2026-02-06 06:31:50 +08:00
[hwasan] fix pthread_exit
llvm-svn: 341594
This commit is contained in:
@@ -44,7 +44,7 @@ void Thread::InsertIntoThreadList(Thread *t) {
|
||||
}
|
||||
|
||||
void Thread::RemoveFromThreadList(Thread *t) {
|
||||
CHECK_NE(t, main_thread);
|
||||
if (t == main_thread) return; // Do nothing (happens due to pthread_exit).
|
||||
SpinMutexLock l(&thread_list_mutex);
|
||||
thread_stats.n_live_threads--;
|
||||
thread_stats.total_stack_size -= t->stack_size();
|
||||
|
||||
5
compiler-rt/test/hwasan/TestCases/pthread_exit.c
Normal file
5
compiler-rt/test/hwasan/TestCases/pthread_exit.c
Normal file
@@ -0,0 +1,5 @@
|
||||
// Tests pthread_exit.
|
||||
// RUN: %clang_hwasan %s -o %t && %run %t
|
||||
// REQUIRES: stable-runtime
|
||||
#include <pthread.h>
|
||||
int main() { pthread_exit(NULL); }
|
||||
Reference in New Issue
Block a user