File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ _PyObject_GET_WEAKREFS_LISTPTR(PyObject *op)
224224 ((PyTypeObject * )op )-> tp_flags & _Py_TPFLAGS_STATIC_BUILTIN ) {
225225 static_builtin_state * state = _PyStaticType_GetState (
226226 (PyTypeObject * )op );
227- return & state -> tp_weaklist ;
227+ return _PyStaticType_GET_WEAKREFS_LISTPTR ( state ) ;
228228 }
229229 Py_ssize_t offset = Py_TYPE (op )-> tp_weaklistoffset ;
230230 return (PyObject * * )((char * )op + offset );
Original file line number Diff line number Diff line change @@ -52,6 +52,13 @@ typedef struct {
5252 PyObject * tp_weaklist ;
5353} static_builtin_state ;
5454
55+ static inline PyObject * *
56+ _PyStaticType_GET_WEAKREFS_LISTPTR (static_builtin_state * state )
57+ {
58+ assert (state != NULL );
59+ return & state -> tp_weaklist ;
60+ }
61+
5562struct types_state {
5663 struct type_cache type_cache ;
5764 size_t num_builtins_initialized ;
You can’t perform that action at this time.
0 commit comments