Skip to content

Commit

Permalink
pythongh-112536: Define _Py_THREAD_SANITIZER on GCC when TSan is en…
Browse files Browse the repository at this point in the history
…abled (python#117702)

The `__has_feature(thread_sanitizer)` is a Clang-ism. Although new
versions of GCC implement `__has_feature`, the `defined(__has_feature)`
check still fails on GCC so we don't use that code path.
  • Loading branch information
colesbury authored and diegorusso committed Apr 17, 2024
1 parent 89c8b7b commit f7aafbb
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Include/pyport.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,9 @@ extern "C" {
# if defined(__SANITIZE_ADDRESS__)
# define _Py_ADDRESS_SANITIZER
# endif
# if defined(__SANITIZE_THREAD__)
# define _Py_THREAD_SANITIZER
# endif
#endif


Expand Down

0 comments on commit f7aafbb

Please sign in to comment.