diff options
author | Sergey Fedoseev <fedoseev.sergey@gmail.com> | 2020-05-25 14:54:40 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-25 14:54:40 (GMT) |
commit | e682b26a6bc6d3db1a44d82db09d26224e82ccb5 (patch) | |
tree | e680c94323d9a5e31b8f8cefd16710a8243a8078 /Objects/tupleobject.c | |
parent | ef16958d17e83723334a51428f410f726d6492a7 (diff) | |
download | cpython-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.c | 3 |
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); |