summaryrefslogtreecommitdiffstats
path: root/Modules/arraymodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'Modules/arraymodule.c')
-rw-r--r--Modules/arraymodule.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/arraymodule.c b/Modules/arraymodule.c
index dcf510e..114c69a 100644
--- a/Modules/arraymodule.c
+++ b/Modules/arraymodule.c
@@ -1773,9 +1773,9 @@ static PyObject *
array_array___sizeof___impl(arrayobject *self)
/*[clinic end generated code: output=d8e1c61ebbe3eaed input=805586565bf2b3c6]*/
{
- Py_ssize_t res;
- res = _PyObject_SIZE(Py_TYPE(self)) + self->allocated * self->ob_descr->itemsize;
- return PyLong_FromSsize_t(res);
+ size_t res = _PyObject_SIZE(Py_TYPE(self));
+ res += (size_t)self->allocated * (size_t)self->ob_descr->itemsize;
+ return PyLong_FromSize_t(res);
}