Skip to content

Commit 04d0796

Browse files
[3.12] gh-112536: Define _Py_THREAD_SANITIZER on GCC when TSan is enabled (GH-117702) (#117713)
gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (GH-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. (cherry picked from commit 79eec66) Co-authored-by: Sam Gross <[email protected]>
1 parent 653ed76 commit 04d0796

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
@@ -757,6 +757,9 @@ extern char * _getpty(int *, int, mode_t, int);
757757
# if defined(__SANITIZE_ADDRESS__)
758758
# define _Py_ADDRESS_SANITIZER
759759
# endif
760+
# if defined(__SANITIZE_THREAD__)
761+
# define _Py_THREAD_SANITIZER
762+
# endif
760763
#endif
761764

762765

0 commit comments

Comments
 (0)