Skip to content

Commit 5dd1909

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 b9b92d3 commit 5dd1909

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
@@ -1388,7 +1388,7 @@ obmalloc controls. Since this test is needed at every entry point, it's
13881388
extremely desirable that it be this fast.
13891389
*/
13901390

1391-
static bool _Py_NO_ADDRESS_SAFETY_ANALYSIS
1391+
static bool _Py_NO_SANITIZE_ADDRESS
13921392
_Py_NO_SANITIZE_THREAD
13931393
_Py_NO_SANITIZE_MEMORY
13941394
address_in_range(void *p, poolp pool)

0 commit comments

Comments
 (0)