]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-135755: Make Py_MAX_SCRIPT_PATH_SIZE private (GH-138350) (#138356)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 16 Sep 2025 12:49:35 +0000 (14:49 +0200)
committerGitHub <noreply@github.com>
Tue, 16 Sep 2025 12:49:35 +0000 (15:49 +0300)
Co-authored-by: Victor Stinner <vstinner@python.org>
Include/cpython/pystate.h
Include/internal/pycore_debug_offsets.h
Modules/posixmodule.c

index be582122118e44edec5af41ca3a7f2c9b90511bb..e7d80f2694baf20b1c802a039e12e6d8dff496f5 100644 (file)
@@ -28,10 +28,10 @@ typedef int (*Py_tracefunc)(PyObject *, PyFrameObject *, int, PyObject *);
 #define PyTrace_OPCODE 7
 
 /* Remote debugger support */
-#define Py_MAX_SCRIPT_PATH_SIZE 512
+#define _Py_MAX_SCRIPT_PATH_SIZE 512
 typedef struct {
     int32_t debugger_pending_call;
-    char debugger_script_path[Py_MAX_SCRIPT_PATH_SIZE];
+    char debugger_script_path[_Py_MAX_SCRIPT_PATH_SIZE];
 } _PyRemoteDebuggerSupport;
 
 typedef struct _err_stackitem {
index 1b59fa2ef6001447f54a4dcbc8e32e6ef943097e..8e7cd16acffa48ac8934df9749350842ed1c4bed 100644 (file)
@@ -368,7 +368,7 @@ typedef struct _Py_DebugOffsets {
         .remote_debugging_enabled = offsetof(PyInterpreterState, config.remote_debug),  \
         .debugger_pending_call = offsetof(_PyRemoteDebuggerSupport, debugger_pending_call),  \
         .debugger_script_path = offsetof(_PyRemoteDebuggerSupport, debugger_script_path),  \
-        .debugger_script_path_size = Py_MAX_SCRIPT_PATH_SIZE, \
+        .debugger_script_path_size = _Py_MAX_SCRIPT_PATH_SIZE, \
     }, \
 }
 
index 904c2f55bbccca949940de379c4084de1479c263..e1576f809fa76618cae60d8f30ad6f472a9a2bfa 100644 (file)
@@ -686,7 +686,7 @@ reset_remotedebug_data(PyThreadState *tstate)
 {
     tstate->remote_debugger_support.debugger_pending_call = 0;
     memset(tstate->remote_debugger_support.debugger_script_path, 0,
-           Py_MAX_SCRIPT_PATH_SIZE);
+           _Py_MAX_SCRIPT_PATH_SIZE);
 }