Skip to content

Commit a4b6f3d

Browse files
Clear GC frame on early return
1 parent 9d8fa7e commit a4b6f3d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

Python/gc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1447,6 +1447,7 @@ gc_collect_main(PyThreadState *tstate, int generation, _PyGC_Reason reason)
14471447
// objects from that generation and all generations younger than it.
14481448
generation = gc_select_generation(gcstate);
14491449
if (generation < 0) {
1450+
gcstate->frame = NULL;
14501451
// No generation needs to be collected.
14511452
_Py_atomic_store_int(&gcstate->collecting, 0);
14521453
return 0;

0 commit comments

Comments
 (0)