Skip to content

Commit

Permalink
pythonGH-128563: Don't leave frame->lltrace uninitialized (pythonGH-1…
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtbucher authored Jan 29, 2025
1 parent 828b276 commit 41ad2bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Include/internal/pycore_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Fix an issue where the "lltrace" debug feature could have been incorrectly
enabled for some frames.

0 comments on commit 41ad2bb

Please sign in to comment.