summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorMark Shannon <mark@hotpy.org>2021-11-22 14:01:23 (GMT)
committerGitHub <noreply@github.com>2021-11-22 14:01:23 (GMT)
commit7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e (patch)
tree46c7f7aed9809c9a7d5f6b6a50eb151b1e2e8a38 /Python
parentd9cedabeba0d87799f99c0717e81743a1c2d34ce (diff)
downloadcpython-7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e.zip
cpython-7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e.tar.gz
cpython-7fd92a8b7ee5bed28c2681fa38e0a1e76200dd8e.tar.bz2
bpo-45813: Make sure that frame->generator is NULLed when generator is deallocated. (GH-29700)
Diffstat (limited to 'Python')
-rw-r--r--Python/frame.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/frame.c b/Python/frame.c
index 3d2415f..a5c93ea 100644
--- a/Python/frame.c
+++ b/Python/frame.c
@@ -99,6 +99,9 @@ take_ownership(PyFrameObject *f, InterpreterFrame *frame)
int
_PyFrame_Clear(InterpreterFrame * frame, int take)
{
+ /* It is the responsibility of the owning generator/coroutine
+ * to have cleared the generator pointer */
+ assert(frame->generator == NULL);
if (frame->frame_obj) {
PyFrameObject *f = frame->frame_obj;
frame->frame_obj = NULL;