]> granicus.if.org Git - python/commitdiff
Backed out changeset ea904d4b3634
authorBenjamin Peterson <benjamin@python.org>
Wed, 14 Dec 2016 07:27:56 +0000 (23:27 -0800)
committerBenjamin Peterson <benjamin@python.org>
Wed, 14 Dec 2016 07:27:56 +0000 (23:27 -0800)
Objects/typeobject.c

index 30da5db8aca3a8b8674b066b9e397aa3483ac872..169a23fe84cdea7a4c8cec6f6ca04f1057433a39 100644 (file)
@@ -6314,12 +6314,12 @@ update_one_slot(PyTypeObject *type, slotdef *p)
                 specific = (void *)slot_tp_new;
             }
             else {
-                PyTypeObject *staticbase = type->tp_base;
                 specific = ((PyTypeObject *)self)->tp_new;
                 /* Check that the user does not do anything
                    silly and unsafe like object.__new__(dict).
                    To do this, we check that the most derived
                    base that's not a heap type is this type. */
+                PyTypeObject *staticbase = type->tp_base;
                 while (staticbase &&
                        (staticbase->tp_flags & Py_TPFLAGS_HEAPTYPE))
                     staticbase = staticbase->tp_base;