]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
GH-128563: Don't leave frame->lltrace uninitialized (GH-129417)
authorBrandt Bucher <brandtbucher@microsoft.com>
Wed, 29 Jan 2025 00:26:46 +0000 (16:26 -0800)
committerGitHub <noreply@github.com>
Wed, 29 Jan 2025 00:26:46 +0000 (16:26 -0800)
Include/internal/pycore_frame.h
Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst [new file with mode: 0644]

index 155a6f3ce054a2894367f05c0476e6bcc7d9287a..f6f2776804e85b97a33f23c49f23ffed5f073e78 100644 (file)
@@ -215,6 +215,9 @@ _PyFrame_Initialize(
     frame->return_offset = 0;
     frame->owner = FRAME_OWNED_BY_THREAD;
     frame->visited = 0;
+#ifdef Py_DEBUG
+    frame->lltrace = 0;
+#endif
 
     for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
         frame->localsplus[i] = PyStackRef_NULL;
@@ -398,6 +401,9 @@ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int
 #endif
     frame->owner = FRAME_OWNED_BY_THREAD;
     frame->visited = 0;
+#ifdef Py_DEBUG
+    frame->lltrace = 0;
+#endif
     frame->return_offset = 0;
 
 #ifdef Py_GIL_DISABLED
diff --git a/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst b/Misc/NEWS.d/next/Core_and_Builtins/2025-01-28-11-13-41.gh-issue-128563.xElppE.rst
new file mode 100644 (file)
index 0000000..dfd932e
--- /dev/null
@@ -0,0 +1,2 @@
+Fix an issue where the "lltrace" debug feature could have been incorrectly
+enabled for some frames.