]> granicus.if.org Git - python/commitdiff
set tp_new from the class in the hierarchy that actually owns the descriptor (closes...
authorBenjamin Peterson <benjamin@python.org>
Tue, 19 Jan 2016 05:17:54 +0000 (21:17 -0800)
committerBenjamin Peterson <benjamin@python.org>
Tue, 19 Jan 2016 05:17:54 +0000 (21:17 -0800)
Debugging by Eryk Sun.

Objects/typeobject.c

index 8a5623f879b4aa6e978187b90758fe13067db16f..baee1f1ad2c418815f508c138187c9e7a36807f4 100644 (file)
@@ -6239,7 +6239,7 @@ update_one_slot(PyTypeObject *type, slotdef *p)
                sanity checks and constructing a new argument
                list.  Cut all that nonsense short -- this speeds
                up instance creation tremendously. */
-            specific = (void *)type->tp_new;
+            specific = (void *)((PyTypeObject *)PyCFunction_GET_SELF(descr))->tp_new;
             /* XXX I'm not 100% sure that there isn't a hole
                in this reasoning that requires additional
                sanity checks.  I'll buy the first person to