[all-commits] [llvm/llvm-project] 4411d1: [sanitizer] Remove GetCurrentThread nullness check...

Fangrui Song via All-commits all-commits at lists.llvm.org
Wed Aug 14 18:32:50 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4411d1e3926d67c393e6a7bdb910bbe77507ff26
      https://github.com/llvm/llvm-project/commit/4411d1e3926d67c393e6a7bdb910bbe77507ff26
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-08-14 (Wed, 14 Aug 2024)

  Changed paths:
    M compiler-rt/lib/asan/asan_allocator.cpp
    M compiler-rt/lib/msan/msan_allocator.cpp

  Log Message:
  -----------
  [sanitizer] Remove GetCurrentThread nullness checks from Allocate

The nullness check is unreachable.

* For the main thead and pthread_create created threads, the `*Allocate` functions must be called after `*_current_thread` is set.
set.
* For threads created by Linux's `clone`, static TLS is either reused or
  set to a new value (CLONE_SETTLS).

Make this change for asan/msan and possibly extend the change to other
sanitizers. (asan supports many platforms and I am not 100% certain that
all platforms have the property.)

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



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list