The hook passed to __sanitizer_thread_exit_hook will be null if we ever call thrd/pthread_exit from the initial thread since __sanitizer_before_thread_create_hook is never called on the initial thread. Rather than using the hook, we can use the normal hwasan machinery for getting the current pointer rather than the hook.
Compiler-RT ================================ This directory and its subdirectories contain source code for the compiler support routines. Compiler-RT is open source software. You may freely distribute it under the terms of the license agreement found in LICENSE.txt. ================================