summaryrefslogtreecommitdiffstats
path: root/Objects/genobject.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2016-09-05 17:40:34 (GMT)
committerBenjamin Peterson <benjamin@python.org>2016-09-05 17:40:34 (GMT)
commit7b24b273024a66e9a024c8866978db2d2cc0b6d3 (patch)
tree9cf20d5d487f73440fcae78585774bc004f470ce /Objects/genobject.c
parent339a6cf79b7d502f8ad0002ebe18037ddc36da53 (diff)
parentbdddb11b0efd438696b5fa3e75f323248c22af7d (diff)
downloadcpython-7b24b273024a66e9a024c8866978db2d2cc0b6d3.zip
cpython-7b24b273024a66e9a024c8866978db2d2cc0b6d3.tar.gz
cpython-7b24b273024a66e9a024c8866978db2d2cc0b6d3.tar.bz2
merge 3.5 (#27812)
Diffstat (limited to 'Objects/genobject.c')
-rw-r--r--Objects/genobject.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/Objects/genobject.c b/Objects/genobject.c
index 7492bdc..f4c5b47 100644
--- a/Objects/genobject.c
+++ b/Objects/genobject.c
@@ -71,7 +71,10 @@ gen_dealloc(PyGenObject *gen)
return; /* resurrected. :( */
_PyObject_GC_UNTRACK(self);
- Py_CLEAR(gen->gi_frame);
+ if (gen->gi_frame != NULL) {
+ gen->gi_frame->f_gen = NULL;
+ Py_CLEAR(gen->gi_frame);
+ }
Py_CLEAR(gen->gi_code);
Py_CLEAR(gen->gi_name);
Py_CLEAR(gen->gi_qualname);