diff options
Diffstat (limited to 'Python/frame.c')
-rw-r--r-- | Python/frame.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Python/frame.c b/Python/frame.c index 14464df..05a8cff 100644 --- a/Python/frame.c +++ b/Python/frame.c @@ -54,6 +54,9 @@ _PyFrame_Copy(_PyInterpreterFrame *src, _PyInterpreterFrame *dest) assert(src->stacktop >= src->f_code->co_nlocalsplus); Py_ssize_t size = ((char*)&src->localsplus[src->stacktop]) - (char *)src; memcpy(dest, src, size); + // Don't leave a dangling pointer to the old frame when creating generators + // and coroutines: + dest->previous = NULL; } |