Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf6602f9

Browse files
bpo-35214: Add _Py_ prefix to MEMORY_SANITIZER def. (GH-10503)
Rename our new MEMORY_SANITIZER define to _Py_MEMORY_SANITIZER.Project based C Preprocessor namespacing at its finest. :P(cherry picked from commit3015fb8)Co-authored-by: Gregory P. Smith <greg@krypto.org>
1 parent5e4a13b commitf6602f9

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

‎Include/Python.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
/* A convenient way for code to know if clang's memory sanitizer is enabled. */
5757
#if defined(__has_feature)
5858
# if__has_feature(memory_sanitizer)
59-
# if !defined(MEMORY_SANITIZER)
60-
# defineMEMORY_SANITIZER
59+
# if !defined(_Py_MEMORY_SANITIZER)
60+
# define_Py_MEMORY_SANITIZER
6161
# endif
6262
# endif
6363
#endif

‎Modules/_ctypes/callproc.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
#include<alloca.h>
7676
#endif
7777

78-
#ifdefMEMORY_SANITIZER
78+
#ifdef_Py_MEMORY_SANITIZER
7979
#include<sanitizer/msan_interface.h>
8080
#endif
8181

@@ -1129,7 +1129,7 @@ PyObject *_ctypes_callproc(PPROC pProc,
11291129
rtype=_ctypes_get_ffi_type(restype);
11301130
resbuf=alloca(max(rtype->size,sizeof(ffi_arg)));
11311131

1132-
#ifdefMEMORY_SANITIZER
1132+
#ifdef_Py_MEMORY_SANITIZER
11331133
/* ffi_call actually initializes resbuf, but from asm, which
11341134
* MemorySanitizer can't detect. Avoid false positives from MSan. */
11351135
if (resbuf!=NULL) {

‎Modules/_posixsubprocess.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
#include<dirent.h>
2222
#endif
2323

24-
#ifdefMEMORY_SANITIZER
24+
#ifdef_Py_MEMORY_SANITIZER
2525
# include<sanitizer/msan_interface.h>
2626
#endif
2727

@@ -291,7 +291,7 @@ _close_open_fds_safe(int start_fd, PyObject* py_fds_to_keep)
291291
sizeof(buffer)))>0) {
292292
structlinux_dirent64*entry;
293293
intoffset;
294-
#ifdefMEMORY_SANITIZER
294+
#ifdef_Py_MEMORY_SANITIZER
295295
__msan_unpoison(buffer,bytes);
296296
#endif
297297
for (offset=0;offset<bytes;offset+=entry->d_reclen) {

‎Objects/fileobject.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#definePY_SSIZE_T_CLEAN
44
#include"Python.h"
55

6-
#if defined(HAVE_GETC_UNLOCKED)&& !defined(MEMORY_SANITIZER)
6+
#if defined(HAVE_GETC_UNLOCKED)&& !defined(_Py_MEMORY_SANITIZER)
77
/* clang MemorySanitizer doesn't yet understand getc_unlocked. */
88
#defineGETC(f) getc_unlocked(f)
99
#defineFLOCKFILE(f) flockfile(f)

‎Python/bootstrap_hash.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# endif
2121
#endif
2222

23-
#ifdefMEMORY_SANITIZER
23+
#ifdef_Py_MEMORY_SANITIZER
2424
# include<sanitizer/msan_interface.h>
2525
#endif
2626

@@ -147,7 +147,7 @@ py_getrandom(void *buffer, Py_ssize_t size, int blocking, int raise)
147147
else {
148148
n=syscall(SYS_getrandom,dest,n,flags);
149149
}
150-
# ifdefMEMORY_SANITIZER
150+
# ifdef_Py_MEMORY_SANITIZER
151151
if (n>0) {
152152
__msan_unpoison(dest,n);
153153
}

‎Python/pymath.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ double _Py_force_double(double x)
1717

1818
/* inline assembly for getting and setting the 387 FPU control word on
1919
gcc/x86 */
20-
#ifdefMEMORY_SANITIZER
20+
#ifdef_Py_MEMORY_SANITIZER
2121
__attribute__((no_sanitize_memory))
2222
#endif
2323
unsigned short_Py_get_387controlword(void) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp