summaryrefslogtreecommitdiffstats
path: root/Objects/tupleobject.c
diff options
context:
space:
mode:
authorSergey Fedoseev <fedoseev.sergey@gmail.com>2020-05-25 14:54:40 (GMT)
committerGitHub <noreply@github.com>2020-05-25 14:54:40 (GMT)
commite682b26a6bc6d3db1a44d82db09d26224e82ccb5 (patch)
treee680c94323d9a5e31b8f8cefd16710a8243a8078 /Objects/tupleobject.c
parentef16958d17e83723334a51428f410f726d6492a7 (diff)
downloadcpython-e682b26a6bc6d3db1a44d82db09d26224e82ccb5.zip
cpython-e682b26a6bc6d3db1a44d82db09d26224e82ccb5.tar.gz
cpython-e682b26a6bc6d3db1a44d82db09d26224e82ccb5.tar.bz2
bpo-34397: Remove redundant overflow checks in list and tuple implementation. (GH-8757)
Diffstat (limited to 'Objects/tupleobject.c')
-rw-r--r--Objects/tupleobject.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Objects/tupleobject.c b/Objects/tupleobject.c
index c0b59c0..1453463 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);