There was an error while loading. Please reload this page.
1 parent 80109d3 commit bdddb11Copy full SHA for bdddb11
2 files changed
Misc/NEWS
@@ -10,6 +10,9 @@ Release date: TBA
10
Core and Builtins
11
-----------------
12
13
+- Issue #27812: Properly clear out a generator's frame's backreference to the
14
+ generator to prevent crashes in frame.clear().
15
+
16
- Issue #27811: Fix a crash when a coroutine that has not been awaited is
17
finalized with warnings-as-errors enabled.
18
Objects/genobject.c
@@ -71,7 +71,10 @@ gen_dealloc(PyGenObject *gen)
71
return; /* resurrected. :( */
72
73
_PyObject_GC_UNTRACK(self);
74
- Py_CLEAR(gen->gi_frame);
+ if (gen->gi_frame != NULL) {
75
+ gen->gi_frame->f_gen = NULL;
76
+ Py_CLEAR(gen->gi_frame);
77
+ }
78
Py_CLEAR(gen->gi_code);
79
Py_CLEAR(gen->gi_name);
80
Py_CLEAR(gen->gi_qualname);
0 commit comments