GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||
GeezerVison is showing github.com — Make Argument Clinic aware of possible UBSan failures · Issue #128180 · python/cpython Closed Labels DescriptionFeature or enhancementA huge part of the CPython code base uses Argument Clinic for generating methods for classes or standalone functions. Generally, methods are then used as follows: static PyMethodDef foo_methods[] = { _FOOMODULE_FOO_BAR_METHODDEF {NULL, NULL} }; where each PyDoc_STRVAR(_foomodule_Foo_bar__doc__, "bar($self, /)\n" "--\n" "\n"); #define _FOOMODULE_FOO_BAR_METHODDEF \ { \ "bar", \ (PyCFunction)_foomodule_Foo_bar, \ METH_NOARGS, \ _foomodule_Foo_bar__doc__ \ }, We also have // @file Modules/foomodule.c /*[clinic input] _foomodule.Foo.bar [clinic start generated code]*/ static PyObject * _foomodule_Foo_bar_impl(FooObject *self) /*[clinic end generated code: output=... input=...]*/ { Py_RETURN_NONE; } // @file Modules/clinic/foomodule.c.h static PyObject * _foomodule_Foo_bar_impl(FooObject *self); static PyObject * _foomodule_Foo_bar(FooObject *self, PyObject *Py_UNUSED(ignored)) { return _foomodule_Foo_bar_impl(self); } Now, in order to fix #111178, we generally convert non-AC clinic methods by changing We can do it if we specify static PyObject * -_foomodule_Foo_bar(FooObject *self, PyObject *Py_UNUSED(ignored)) +_foomodule_Foo_bar(PyObject *self, PyObject *Py_UNUSED(ignored)) { - return _foomodule_Foo_bar_impl(self); + return _foomodule_Foo_bar_impl((FooObject *)self); } I decided to open a separate issue to track this change orthogonally to the UBSan failures fixes that can be achieved without any AC changes. I hope that this will not deterioriate the performances of CPython too much. Note: this does not only affect methods as above; this affects any method that is casted to Activity
MetadataMetadataAssigneesLabelsProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||||||||||
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |