Skip to content

Commit 5641b6d

Browse files
closes bpo-30364: Replace deprecated no_address_safety_analysis attribute. (GH-17702)
(cherry picked from commit c0052f3) Co-authored-by: Batuhan Taşkaya <[email protected]>
1 parent 090bc14 commit 5641b6d

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
@@ -30,8 +30,8 @@ static void _PyMem_SetupDebugHooksDomain(PyMemAllocatorDomain domain);
3030

3131
#if defined(__has_feature) /* Clang */
3232
# if __has_feature(address_sanitizer) /* is ASAN enabled? */
33-
# define _Py_NO_ADDRESS_SAFETY_ANALYSIS \
34-
__attribute__((no_address_safety_analysis))
33+
# define _Py_NO_SANITIZE_ADDRESS \
34+
__attribute__((no_sanitize("address")))
3535
# endif
3636
# if __has_feature(thread_sanitizer) /* is TSAN enabled? */
3737
# define _Py_NO_SANITIZE_THREAD __attribute__((no_sanitize_thread))
@@ -41,8 +41,8 @@ static void _PyMem_SetupDebugHooksDomain(PyMemAllocatorDomain domain);
4141
# endif
4242
#elif defined(__GNUC__)
4343
# if defined(__SANITIZE_ADDRESS__) /* GCC 4.8+, is ASAN enabled? */
44-
# define _Py_NO_ADDRESS_SAFETY_ANALYSIS \
45-
__attribute__((no_address_safety_analysis))
44+
# define _Py_NO_SANITIZE_ADDRESS \
45+
__attribute__((no_sanitize_address))
4646
# endif
4747
// TSAN is supported since GCC 5.1, but __SANITIZE_THREAD__ macro
4848
// is provided only since GCC 7.
@@ -51,8 +51,8 @@ static void _PyMem_SetupDebugHooksDomain(PyMemAllocatorDomain domain);
5151
# endif
5252
#endif
5353

54-
#ifndef _Py_NO_ADDRESS_SAFETY_ANALYSIS
55-
# define _Py_NO_ADDRESS_SAFETY_ANALYSIS
54+
#ifndef _Py_NO_SANITIZE_ADDRESS
55+
# define _Py_NO_SANITIZE_ADDRESS
5656
#endif
5757
#ifndef _Py_NO_SANITIZE_THREAD
5858
# define _Py_NO_SANITIZE_THREAD
@@ -1350,7 +1350,7 @@ obmalloc controls. Since this test is needed at every entry point, it's
13501350
extremely desirable that it be this fast.
13511351
*/
13521352

1353-
static bool _Py_NO_ADDRESS_SAFETY_ANALYSIS
1353+
static bool _Py_NO_SANITIZE_ADDRESS
13541354
_Py_NO_SANITIZE_THREAD
13551355
_Py_NO_SANITIZE_MEMORY
13561356
address_in_range(void *p, poolp pool)

0 commit comments

Comments
 (0)