]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
don't run frame if it has no stack (closes #17669)
authorBenjamin Peterson <benjamin@python.org>
Wed, 10 Apr 2013 21:00:56 +0000 (17:00 -0400)
committerBenjamin Peterson <benjamin@python.org>
Wed, 10 Apr 2013 21:00:56 +0000 (17:00 -0400)
Misc/NEWS
Objects/genobject.c

index 826ad8586099d1589e37de184a8b3eb2a92c1814..05414e365a7a965d57426c55a11490642cd68b4b 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -12,6 +12,8 @@ What's New in Python 3.3.2?
 Core and Builtins
 -----------------
 
+- Issue #17669: Fix crash involving finalization of generators using yield from.
+
 - Issue #17619: Make input() check for Ctrl-C correctly on Windows.
 
 - Issue #17610: Don't rely on non-standard behavior of the C qsort() function.
index 597aed37a116116d242392f9caf7aeba6b01fe2e..016bfa297522c8fe71f0d2085b407124dffb0817 100644 (file)
@@ -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);