summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2009-04-25 00:41:22 (GMT)
committerBenjamin Peterson <benjamin@python.org>2009-04-25 00:41:22 (GMT)
commit5083dc552b4e7026c2f405b37d7691131bc96955 (patch)
treea8ae47a8e0a88ae2a37add5c89a06d291490cc5e /Objects
parent5c6af808f7721787dcce1bc6bfe14f225f9db6f3 (diff)
downloadcpython-5083dc552b4e7026c2f405b37d7691131bc96955.zip
cpython-5083dc552b4e7026c2f405b37d7691131bc96955.tar.gz
cpython-5083dc552b4e7026c2f405b37d7691131bc96955.tar.bz2
fix a segfault when setting __class__ in __del__ #5283
Diffstat (limited to 'Objects')
-rw-r--r--Objects/typeobject.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index cf5e2a9..304066f 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -928,6 +928,9 @@ subtype_dealloc(PyObject *self)
assert(base);
}
+ /* Extract the type again; tp_del may have changed it */
+ type = Py_TYPE(self);
+
/* Call the base tp_dealloc() */
assert(basedealloc);
basedealloc(self);
@@ -1009,6 +1012,9 @@ subtype_dealloc(PyObject *self)
}
}
+ /* Extract the type again; tp_del may have changed it */
+ type = Py_TYPE(self);
+
/* Call the base tp_dealloc(); first retrack self if
* basedealloc knows about gc.
*/