diff options
author | Mark Shannon <mark@hotpy.org> | 2021-06-10 11:37:22 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-10 11:37:22 (GMT) |
commit | 31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b (patch) | |
tree | 1ce0b4151af7504e454ec387be4406d8fdc1e537 /Include/Python.h | |
parent | 54cb63863f19a7c64d9a3a5fd97bdfc0dd7ab374 (diff) | |
download | cpython-31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b.zip cpython-31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b.tar.gz cpython-31aa0dbff4c1d39c9d77c6c8f4a61d0e46c1268b.tar.bz2 |
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)
Diffstat (limited to 'Include/Python.h')
-rw-r--r-- | Include/Python.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/Include/Python.h b/Include/Python.h index 4d0335d..04858f2 100644 --- a/Include/Python.h +++ b/Include/Python.h @@ -63,13 +63,22 @@ #include "pyport.h" #include "pymacro.h" -/* A convenient way for code to know if clang's memory sanitizer is enabled. */ +/* A convenient way for code to know if sanitizers are enabled. */ #if defined(__has_feature) # if __has_feature(memory_sanitizer) # if !defined(_Py_MEMORY_SANITIZER) # define _Py_MEMORY_SANITIZER # endif # endif +# if __has_feature(address_sanitizer) +# if !defined(_Py_ADDRESS_SANITIZER) +# define _Py_ADDRESS_SANITIZER +# endif +# endif +#elif defined(__GNUC__) +# if defined(__SANITIZE_ADDRESS__) +# define _Py_ADDRESS_SANITIZER +# endif #endif #include "pymath.h" |