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

Skip to content
8000

gh-111178: fix UBSan failures in Objects/bytearrayobject.c #128236

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 2 commits into from
Jan 10, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix UBSan failures for PyByteArrayObject
  • Loading branch information
picnixz committed Dec 24, 2024
commit e84fd505cdb3c9acf3f5615a33aee4f9a8f959b8
5 changes: 3 additions & 2 deletions Objects/bytearrayobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2113,8 +2113,9 @@ PyDoc_STRVAR(alloc_doc,
Return the number of bytes actually allocated.");

static PyObject *
bytearray_alloc(PyByteArrayObject *self, PyObject *Py_UNUSED(ignored))
bytearray_alloc(PyObject *op, PyObject *Py_UNUSED(ignored))
{
PyByteArrayObject *self = _PyByteArray_CAST(op);
return PyLong_FromSsize_t(self->ob_alloc);
}

Expand Down Expand Up @@ -2313,7 +2314,7 @@ static PyBufferProcs bytearray_as_buffer = {
};

static PyMethodDef bytearray_methods[] = {
{"__alloc__", (PyCFunction)bytearray_alloc, METH_NOARGS, alloc_doc},
{"__alloc__", bytearray_alloc, METH_NOARGS, alloc_doc},
BYTEARRAY_REDUCE_METHODDEF
BYTEARRAY_REDUCE_EX_METHODDEF
BYTEARRAY_SIZEOF_METHODDEF
Expand Down
Loading
0