summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2013-04-10 21:00:56 (GMT)
committerBenjamin Peterson <benjamin@python.org>2013-04-10 21:00:56 (GMT)
commitc9314d9e08309782010b56a41bb2d28c6a556302 (patch)
tree6e1b43b68da2da88e5a1bb714848a7fceac5d65f /Objects/genobject.c
parentcd514cf175ef820fe62f7e201f596f930d4b1d02 (diff)
downloadcpython-c9314d9e08309782010b56a41bb2d28c6a556302.zip
cpython-c9314d9e08309782010b56a41bb2d28c6a556302.tar.gz
cpython-c9314d9e08309782010b56a41bb2d28c6a556302.tar.bz2
don't run frame if it has no stack (closes #17669)
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 597aed3..016bfa2 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -178,7 +178,7 @@ gen_yf(PyGenObject *gen)
PyObject *yf = NULL;
PyFrameObject *f = gen->gi_frame;
- if (f) {
+ if (f && f->f_stacktop) {
PyObject *bytecode = f->f_code->co_code;
unsigned char *code = (unsigned char *)PyBytes_AS_STRING(bytecode);