Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Set ``PyCode_Type.tp_basicsize`` to ``sizeof(PyCodeObject)``. Cython makes the
assumption that ``PyCode_Type.tp_basicsize`` equals to
``sizeof(PyCodeObject)``. This assumption is no longer true since the commit
2bde6827ea4f136297b2d882480b981ff26262b6. Restore ``tp_basicsize`` until the
PyCodeObject structure can use a C99 flexible array of size zero with the
syntax ``char co_code_adaptive[]``. Patch by Victor Stinner.
2 changes: 1 addition & 1 deletion Objects/codeobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -1910,7 +1910,7 @@ static struct PyMethodDef code_methods[] = {
PyTypeObject PyCode_Type = {
PyVarObject_HEAD_INIT(&PyType_Type, 0)
"code",
offsetof(PyCodeObject, co_code_adaptive),
sizeof(PyCodeObject),
sizeof(_Py_CODEUNIT),
(destructor)code_dealloc, /* tp_dealloc */
0, /* tp_vectorcall_offset */
Expand Down