Skip to content

Commit 6938997

Browse files
committed
fix
1 parent a9952ac commit 6938997

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Objects/typeobject.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems)
12901290
{
12911291
PyObject *obj;
12921292
size_t extra = 0;
1293-
if (type->tp_flags & Py_TPFLAGS_TYPE_SUBCLASS) {
1293+
if (type->tp_flags & Py_TPFLAGS_TYPE_SUBCLASS || type->tp_vectorcall != NULL) {
12941294
/* note that we need to add one, for the sentinel */
12951295
extra = 1;
12961296
}
@@ -1312,7 +1312,7 @@ _PyType_AllocNoTrack(PyTypeObject *type, Py_ssize_t nitems)
13121312
_PyObject_Init(obj, type);
13131313
}
13141314
else {
1315-
_PyObject_InitVar((PyVarObject *)obj, type, nitems);
1315+
_PyObject_InitVar((PyVarObject *)obj, type, nitems + extra);
13161316
}
13171317
return obj;
13181318
}

0 commit comments

Comments
 (0)