Skip to content

Commit 41ad2bb

Browse files
authored
GH-128563: Don't leave frame->lltrace uninitialized (GH-129417)
1 parent 828b276 commit 41ad2bb

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Include/internal/pycore_frame.h

+6
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ _PyFrame_Initialize(
215215
frame->return_offset = 0;
216216
frame->owner = FRAME_OWNED_BY_THREAD;
217217
frame->visited = 0;
218+
#ifdef Py_DEBUG
219+
frame->lltrace = 0;
220+
#endif
218221

219222
for (int i = null_locals_from; i < code->co_nlocalsplus; i++) {
220223
frame->localsplus[i] = PyStackRef_NULL;
@@ -398,6 +401,9 @@ _PyFrame_PushTrampolineUnchecked(PyThreadState *tstate, PyCodeObject *code, int
398401
#endif
399402
frame->owner = FRAME_OWNED_BY_THREAD;
400403
frame->visited = 0;
404+
#ifdef Py_DEBUG
405+
frame->lltrace = 0;
406+
#endif
401407
frame->return_offset = 0;
402408

403409
#ifdef Py_GIL_DISABLED
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix an issue where the "lltrace" debug feature could have been incorrectly
2+
enabled for some frames.

0 commit comments

Comments
 (0)