8000 gh-111178: fix UBSan failures in `Modules/_operator.c` by picnixz · Pull Request #129785 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-111178: fix UBSan failures in Modules/_opera 8000 tor.c #129785

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Feb 20, 2025
Merged
Prev Previous commit
Next Next commit
Use dummy parameter when for NOARGS method
Semantically, this helps differencing a NOARGS from a VARARGS method without looking at the flags.
  • Loading branch information
picnixz authored Feb 7, 2025
commit a75ffb38bb118d68ea9ed22743745f094ef0831d
8 changes: 4 additions & 4 deletions Modules/_operator.c
Original file line number Diff line number Diff line change
Expand Up @@ -999,7 +999,7 @@ static struct PyMethodDef operator_methods[] = {


static PyObject *
text_signature(PyObject *Py_UNUSED(self), void *Py_UNUSED(ignored))
text_signature(PyObject *Py_UNUSED(self), void *Py_UNUSED(closure))
{
return PyUnicode_FromString("(obj, /)");
}
Expand Down Expand Up @@ -1187,7 +1187,7 @@ itemgetter_repr(PyObject *op)
}

static PyObject *
itemgetter_reduce(PyObject *op, PyObject *Py_UNUSED(args))
itemgetter_reduce(PyObject *op, PyObject *Py_UNUSED(dummy))
{
itemgetterobject *ig = _itemgetterobject_CAST(op);
if (ig->nitems == 1)
Expand Down Expand Up @@ -1553,7 +1553,7 @@ attrgetter_repr(PyObject *op)
}

static PyObject *
attrgetter_reduce(PyObject *op, PyObject *Py_UNUSED(args))
attrgetter_reduce(PyObject *op, PyObject *Py_UNUSED(dummy))
{
attrgetterobject *ag = _attrgetterobject_CAST(op);
PyObject *attrstrings = attrgetter_args(ag);
Expand Down Expand Up @@ -1870,7 +1870,7 @@ methodcaller_repr(PyObject *op)
}

static PyObject *
methodcaller_reduce(PyObject *op, PyObject *Py_UNUSED(args))
methodcaller_reduce(PyObject *op, PyObject *Py_UNUSED(dummy))
{
methodcallerobject *mc = _methodcallerobject_CAST(op);
if (!mc->kwds || PyDict_GET_SIZE(mc->kwds) == 0) {
Expand Down
Loading
0