Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
corona10 committed Jan 9, 2023
1 parent a9952ac commit 6938997
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Objects/typeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1290,7 +1290,7 @@ _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems)
{
PyObject *obj;
size_t extra = 0;
if (type->tp_flags & Py_TPFLAGS_TYPE_SUBCLASS) {
if (type->tp_flags & Py_TPFLAGS_TYPE_SUBCLASS || type->tp_vectorcall != NULL) {
/* note that we need to add one, for the sentinel */
extra = 1;
}
Expand All @@ -1312,7 +1312,7 @@ _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems)
_PyObject_Init(obj, type);
}
else {
_PyObject_InitVar((PyVarObject *)obj, type, nitems);
_PyObject_InitVar((PyVarObject *)obj, type, nitems + extra);
}
return obj;
}
Expand Down

0 comments on commit 6938997

Please sign in to comment.