From: Bénédikt Tran <10796600+picnixz@users.noreply.github.com> Date: Sun, 23 Mar 2025 14:26:03 +0000 (+0100) Subject: gh-111178: fix UBSan failures for `TaskStepMethWrapper` (#131602) X-Git-Tag: v3.14.0a7~238 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef06508f8ef1d2943b2fb1e310ab115b65e489a8;p=thirdparty%2FPython%2Fcpython.git gh-111178: fix UBSan failures for `TaskStepMethWrapper` (#131602) --- diff --git a/Modules/_asynciomodule.c b/Modules/_asynciomodule.c index 3c2622acdd14..28234c4f902a 100644 --- a/Modules/_asynciomodule.c +++ b/Modules/_asynciomodule.c @@ -2121,8 +2121,9 @@ TaskStepMethWrapper_traverse(PyObject *op, } static PyObject * -TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored)) +TaskStepMethWrapper_get___self__(PyObject *op, void *Py_UNUSED(closure)) { + TaskStepMethWrapper *o = (TaskStepMethWrapper*)op; if (o->sw_task) { return Py_NewRef(o->sw_task); } @@ -2130,7 +2131,7 @@ TaskStepMethWrapper_get___self__(TaskStepMethWrapper *o, void *Py_UNUSED(ignored } static PyGetSetDef TaskStepMethWrapper_getsetlist[] = { - {"__self__", (getter)TaskStepMethWrapper_get___self__, NULL, NULL}, + {"__self__", TaskStepMethWrapper_get___self__, NULL, NULL}, {NULL} /* Sentinel */ };