gh-111178: fix UBSan failures for PyBytesObject (#131603)
This commit is contained in:
@@ -2649,15 +2649,16 @@ bytes_hex_impl(PyBytesObject *self, PyObject *sep, int bytes_per_sep)
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
bytes_getnewargs(PyBytesObject *v, PyObject *Py_UNUSED(ignored))
|
||||
bytes_getnewargs(PyObject *op, PyObject *Py_UNUSED(dummy))
|
||||
{
|
||||
PyBytesObject *v = _PyBytes_CAST(op);
|
||||
return Py_BuildValue("(y#)", v->ob_sval, Py_SIZE(v));
|
||||
}
|
||||
|
||||
|
||||
static PyMethodDef
|
||||
bytes_methods[] = {
|
||||
{"__getnewargs__", (PyCFunction)bytes_getnewargs, METH_NOARGS},
|
||||
{"__getnewargs__", bytes_getnewargs, METH_NOARGS},
|
||||
BYTES___BYTES___METHODDEF
|
||||
{"capitalize", stringlib_capitalize, METH_NOARGS,
|
||||
_Py_capitalize__doc__},
|
||||
|
||||
Reference in New Issue
Block a user