Skip to content

Commit c0052f3

Browse files
isidenticalbenjaminp
authored andcommitted
closes bpo-30364: Replace deprecated no_address_safety_analysis attribute. (GH-17702)
1 parent f460eea commit c0052f3

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Objects/obmalloc.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ static void _PyMem_SetupDebugHooksDomain(PyMemAllocatorDomain domain);
3131

3232
#if defined(__has_feature) /* Clang */
3333
# if __has_feature(address_sanitizer) /* is ASAN enabled? */
34-
# define _Py_NO_ADDRESS_SAFETY_ANALYSIS \
35-
__attribute__((no_address_safety_analysis))
34+
# define _Py_NO_SANITIZE_ADDRESS \
35+
__attribute__((no_sanitize("address")))
3636
# endif
3737
# if __has_feature(thread_sanitizer) /* is TSAN enabled? */
3838
# define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
@@ -42,8 +42,8 @@ static void _PyMem_SetupDebugHooksDomain(PyMemAllocatorDomain domain);
4242
# endif
4343
#elif defined(__GNUC__)
4444
# if defined(__SANITIZE_ADDRESS__) /* GCC 4.8+, is ASAN enabled? */
45-
# define _Py_NO_ADDRESS_SAFETY_ANALYSIS \
46-
__attribute__((no_address_safety_analysis))
45+
# define _Py_NO_SANITIZE_ADDRESS \
46+
__attribute__((no_sanitize_address))
4747
# endif
4848
// TSAN is supported since GCC 5.1, but __SANITIZE_THREAD__ macro
4949
// is provided only since GCC 7.
@@ -52,8 +52,8 @@ static void _PyMem_SetupDebugHooksDomain(PyMemAllocatorDomain domain);
5252
# endif
5353
#endif
5454

55-
#ifndef _Py_NO_ADDRESS_SAFETY_ANALYSIS
56-
# define _Py_NO_ADDRESS_SAFETY_ANALYSIS
55+
#ifndef _Py_NO_SANITIZE_ADDRESS
56+
# define _Py_NO_SANITIZE_ADDRESS
5757
#endif
5858
#ifndef _Py_NO_SANITIZE_THREAD
5959
# define _Py_NO_SANITIZE_THREAD
@@ -1407,7 +1407,7 @@ obmalloc controls. Since this test is needed at every entry point, it's
14071407
extremely desirable that it be this fast.
14081408
*/
14091409

1410-
static bool _Py_NO_ADDRESS_SAFETY_ANALYSIS
1410+
static bool _Py_NO_SANITIZE_ADDRESS
14111411
_Py_NO_SANITIZE_THREAD
14121412
_Py_NO_SANITIZE_MEMORY
14131413
address_in_range(void *p, poolp pool)

0 commit comments

Comments
 (0)