Core and Builtins
-----------------
+- Issue #27812: Properly clear out a generator's frame's backreference to the
+ generator to prevent crashes in frame.clear().
+
- Issue #27811: Fix a crash when a coroutine that has not been awaited is
finalized with warnings-as-errors enabled.
return; /* resurrected. :( */
_PyObject_GC_UNTRACK(self);
- Py_CLEAR(gen->gi_frame);
+ if (gen->gi_frame != NULL) {
+ gen->gi_frame->f_gen = NULL;
+ Py_CLEAR(gen->gi_frame);
+ }
Py_CLEAR(gen->gi_code);
Py_CLEAR(gen->gi_name);
Py_CLEAR(gen->gi_qualname);