@@ -590,8 +590,9 @@ _gen_throw(PyGenObject *gen, int close_on_genexit,
590590
591591
592592static  PyObject  * 
593- gen_throw (PyGenObject   * gen , PyObject  * const  * args , Py_ssize_t  nargs )
593+ gen_throw (PyObject   * op , PyObject  * const  * args , Py_ssize_t  nargs )
594594{
595+     PyGenObject  * gen  =  _PyGen_CAST (op );
595596    PyObject  * typ ;
596597    PyObject  * tb  =  NULL ;
597598    PyObject  * val  =  NULL ;
@@ -821,8 +822,9 @@ static PyMemberDef gen_memberlist[] = {
821822};
822823
823824static  PyObject  * 
824- gen_sizeof (PyGenObject   * gen , PyObject  * Py_UNUSED (ignored ))
825+ gen_sizeof (PyObject   * op , PyObject  * Py_UNUSED (ignored ))
825826{
827+     PyGenObject  * gen  =  _PyGen_CAST (op );
826828    Py_ssize_t  res ;
827829    res  =  offsetof(PyGenObject , gi_iframe ) +  offsetof(_PyInterpreterFrame , localsplus );
828830    PyCodeObject  * code  =  _PyGen_GetCode (gen );
@@ -837,7 +839,7 @@ static PyMethodDef gen_methods[] = {
837839    {"send" , gen_send , METH_O , send_doc },
838840    {"throw" , _PyCFunction_CAST (gen_throw ), METH_FASTCALL , throw_doc },
839841    {"close" , gen_close , METH_NOARGS , close_doc },
840-     {"__sizeof__" , ( PyCFunction ) gen_sizeof , METH_NOARGS , sizeof__doc__ },
842+     {"__sizeof__" , gen_sizeof , METH_NOARGS , sizeof__doc__ },
841843    {"__class_getitem__" , Py_GenericAlias , METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
842844    {NULL , NULL }        /* Sentinel */ 
843845};
@@ -1197,7 +1199,7 @@ static PyMethodDef coro_methods[] = {
11971199    {"send" , gen_send , METH_O , coro_send_doc },
11981200    {"throw" ,_PyCFunction_CAST (gen_throw ), METH_FASTCALL , coro_throw_doc },
11991201    {"close" , gen_close , METH_NOARGS , coro_close_doc },
1200-     {"__sizeof__" , ( PyCFunction ) gen_sizeof , METH_NOARGS , sizeof__doc__ },
1202+     {"__sizeof__" , gen_sizeof , METH_NOARGS , sizeof__doc__ },
12011203    {"__class_getitem__" , Py_GenericAlias , METH_O |METH_CLASS , PyDoc_STR ("See PEP 585" )},
12021204    {NULL , NULL }        /* Sentinel */ 
12031205};
@@ -1288,7 +1290,7 @@ static PyObject *
12881290coro_wrapper_throw (PyObject  * self , PyObject  * const  * args , Py_ssize_t  nargs )
12891291{
12901292    PyCoroWrapper  * cw  =  _PyCoroWrapper_CAST (self );
1291-     return  gen_throw ((PyGenObject   * )cw -> cw_coroutine , args , nargs );
1293+     return  gen_throw ((PyObject * )cw -> cw_coroutine , args , nargs );
12921294}
12931295
12941296static  PyObject  * 
@@ -1625,7 +1627,7 @@ static PyMethodDef async_gen_methods[] = {
16251627    {"asend" , (PyCFunction )async_gen_asend , METH_O , async_asend_doc },
16261628    {"athrow" ,(PyCFunction )async_gen_athrow , METH_VARARGS , async_athrow_doc },
16271629    {"aclose" , (PyCFunction )async_gen_aclose , METH_NOARGS , async_aclose_doc },
1628-     {"__sizeof__" , ( PyCFunction ) gen_sizeof , METH_NOARGS , sizeof__doc__ },
1630+     {"__sizeof__" , gen_sizeof , METH_NOARGS , sizeof__doc__ },
16291631    {"__class_getitem__" ,    Py_GenericAlias ,
16301632    METH_O |METH_CLASS ,       PyDoc_STR ("See PEP 585" )},
16311633    {NULL , NULL }        /* Sentinel */ 
@@ -1842,7 +1844,7 @@ async_gen_asend_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
18421844        o -> ags_gen -> ag_running_async  =  1 ;
18431845    }
18441846
1845-     PyObject  * result  =  gen_throw ((PyGenObject * )o -> ags_gen , args , nargs );
1847+     PyObject  * result  =  gen_throw ((PyObject * )o -> ags_gen , args , nargs );
18461848    result  =  async_gen_unwrap_value (o -> ags_gen , result );
18471849
18481850    if  (result  ==  NULL ) {
@@ -2249,7 +2251,7 @@ async_gen_athrow_throw(PyObject *self, PyObject *const *args, Py_ssize_t nargs)
22492251        o -> agt_gen -> ag_running_async  =  1 ;
22502252    }
22512253
2252-     PyObject  * retval  =  gen_throw ((PyGenObject * )o -> agt_gen , args , nargs );
2254+     PyObject  * retval  =  gen_throw ((PyObject * )o -> agt_gen , args , nargs );
22532255    if  (o -> agt_args ) {
22542256        retval  =  async_gen_unwrap_value (o -> agt_gen , retval );
22552257        if  (retval  ==  NULL ) {
0 commit comments