Skip to content

Commit 79eec66

Browse files
authored
gh-112536: Define _Py_THREAD_SANITIZER on GCC when TSan is enabled (#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.
1 parent ef41182 commit 79eec66

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Include/pyport.h

+3
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,9 @@ extern "C" {
572572
# if defined(__SANITIZE_ADDRESS__)
573573
# define _Py_ADDRESS_SANITIZER
574574
# endif
575+
# if defined(__SANITIZE_THREAD__)
576+
# define _Py_THREAD_SANITIZER
577+
# endif
575578
#endif
576579

577580

0 commit comments

Comments
 (0)