GH-128563: Don't leave frame->lltrace uninitialized (GH-129417)

This commit is contained in:
Brandt Bucher 2025-01-28 16:26:46 -08:00 committed by GitHub
parent 828b27680f
commit 41ad2bb248
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View 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

View file

@ -0,0 +1,2 @@
Fix an issue where the "lltrace" debug feature could have been incorrectly
enabled for some frames.