From e682b26a6bc6d3db1a44d82db09d26224e82ccb5 Mon Sep 17 00:00:00 2001 From: Sergey Fedoseev Date: Mon, 25 May 2020 19:54:40 +0500 Subject: bpo-34397: Remove redundant overflow checks in list and tuple implementation. (GH-8757) --- Objects/tupleobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Objects/tupleobject.c') diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c index c0b59c009a..14534632df 100644 --- a/Objects/tupleobject.c +++ b/Objects/tupleobject.c @@ -486,8 +486,7 @@ tupleconcat(PyTupleObject *a, PyObject *bb) Py_INCREF(a); return (PyObject *)a; } - if (Py_SIZE(a) > PY_SSIZE_T_MAX - Py_SIZE(b)) - return PyErr_NoMemory(); + assert((size_t)Py_SIZE(a) + (size_t)Py_SIZE(b) < PY_SSIZE_T_MAX); size = Py_SIZE(a) + Py_SIZE(b); if (size == 0) { return PyTuple_New(0); -- cgit v1.2.1