mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)
(cherry picked from commit 31aa0dbff4
)
Co-authored-by: Mark Shannon <mark@hotpy.org>
This commit is contained in:
parent
d9f38d77c8
commit
865269458f
3 changed files with 17 additions and 1 deletions
|
@ -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
|
||||
|
||||
/* Debug-mode build with pymalloc implies PYMALLOC_DEBUG.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue