Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9314d9

Browse files
committed
don't run frame if it has no stack (closes #17669)
1 parent cd514cf commit c9314d9

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ What's New in Python 3.3.2?
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #17669: Fix crash involving finalization of generators using yield from.
16+
1517
- Issue #17619: Make input() check for Ctrl-C correctly on Windows.
1618

1719
- Issue #17610: Don't rely on non-standard behavior of the C qsort() function.

Objects/genobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ gen_yf(PyGenObject *gen)
178178
PyObject *yf = NULL;
179179
PyFrameObject *f = gen->gi_frame;
180180

181-
if (f) {
181+
if (f && f->f_stacktop) {
182182
PyObject *bytecode = f->f_code->co_code;
183183
unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode);
184184

0 commit comments

Comments
 (0)