[compiler-rt] [sanitizer] Remove GetCurrentThread nullness checks from Allocate (PR #102828)

Fangrui Song via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 11 23:01:52 PDT 2024


MaskRay wrote:

> > The `*Allocate` functions must be called after `*_current_thread` is set. Delete the nullness checks.
> 
> With static runtime.
> 
> With dynamic runtime, with late activation, it's not guaranteed, I guess?

I've checked `start-deactivated.cpp`. In the `ASAN_OPTIONS=start_deactivated=1` mode, interceptors are still initialized.
As long as `DlsymAlloc::Use()` in the interceptor returns false and `__asan::Allocator::Allocate` is called, `GetCurrentThread()` guarantees a non-null value.

https://github.com/llvm/llvm-project/pull/102828


More information about the llvm-commits mailing list