cpython: 747855f29b9d (original) (raw)

Mercurial > cpython

changeset 94349:747855f29b9d 3.4

Issue #22079: PyType_Ready() now checks that statically allocated type has no dynamically allocated bases. [#22079]

Serhiy Storchaka storchaka@gmail.com
date Wed, 28 Jan 2015 11:03:33 +0200
parents eecaa42e0c06
children eb26255e11f1 8dfbaa2e8d26
files Misc/NEWS Objects/typeobject.c
diffstat 2 files changed, 21 insertions(+), 0 deletions(-)[+] [-] Misc/NEWS 7 Objects/typeobject.c 14

line wrap: on

line diff

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -332,6 +332,12 @@ Build

--- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -4680,6 +4680,20 @@ PyType_Ready(PyTypeObject *type) inherit_slots(type, (PyTypeObject *)b); }

+ /* Sanity check for tp_free. */ if (PyType_IS_GC(type) && (type->tp_flags & Py_TPFLAGS_BASETYPE) && (type->tp_free == NULL || type->tp_free == PyObject_Del)) {