[all-commits] [llvm/llvm-project] 8e79ad: [libc][LIBC_ADD_NULL_CHECKS] replace volatile dere...

Nick Desaulniers via All-commits all-commits at lists.llvm.org
Wed Jan 22 09:35:22 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8e79ade49d68c49aeb8ba008b59f559b86d22765
      https://github.com/llvm/llvm-project/commit/8e79ade49d68c49aeb8ba008b59f559b86d22765
  Author: Nick Desaulniers <nickdesaulniers at users.noreply.github.com>
  Date:   2025-01-22 (Wed, 22 Jan 2025)

  Changed paths:
    M libc/src/__support/macros/null_check.h
    M libc/test/src/math/smoke/nan_test.cpp
    M libc/test/src/math/smoke/nanf128_test.cpp
    M libc/test/src/math/smoke/nanf16_test.cpp
    M libc/test/src/math/smoke/nanf_test.cpp
    M libc/test/src/math/smoke/nanl_test.cpp

  Log Message:
  -----------
  [libc][LIBC_ADD_NULL_CHECKS] replace volatile deref with __builtin_trap (#123401)

Also, update the unit tests that were checking for SIGSEGV to not check for a
specific signal.

To further improve this check, it may be worth:
- renaming the configuration option/macro/docs to be clearer about intent.
- swap __builtin_trap for __builtin_unreachable, removing the preprocessor
  variants of LIBC_CRASH_ON_NULLPTR, then unconditionally using
  `-fsanitize=unreachable -fsanitize-trap=unreachable` in cmake flags when
  LIBC_ADD_NULL_CHECKS is enabled.
- building with `-fno-delete-null-pointer-checks` when LIBC_ADD_NULL_CHECKS (or
  when some larger yet to be added hardening config) is enabled.

Link: #111546



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