Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix assertion in subtype_dealloc()
Pass the type, not the object
  • Loading branch information
vstinner committed Oct 26, 2018
commit 804fdae2bdb7bed1753c0bc1c278fdb894b238db
4 changes: 2 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,7 @@ subtype_dealloc(PyObject *self)

/* Extract the type; we expect it to be a heap type */
type = Py_TYPE(self);
_PyObject_ASSERT(self, type->tp_flags & Py_TPFLAGS_HEAPTYPE);
_PyObject_ASSERT((PyObject *)type, type->tp_flags & Py_TPFLAGS_HEAPTYPE);

/* Test whether the type has GC exactly once */

Expand Down Expand Up @@ -2217,7 +2217,7 @@ subtype_getweakref(PyObject *obj, void *context)
_PyObject_ASSERT(obj, Py_TYPE(obj)->tp_weaklistoffset > 0);
_PyObject_ASSERT(obj,
(Py_TYPE(obj)->tp_weaklistoffset + sizeof(PyObject *)) \
<= (size_t)(Py_TYPE(obj)->tp_basicsize));
<= (size_t)(Py_TYPE(obj)->tp_basicsize));
weaklistptr = (PyObject **)
((char *)obj + Py_TYPE(obj)->tp_weaklistoffset);
if (*weaklistptr == NULL)
Expand Down