summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_list.py
diff options
context:
space:
mode:
authorHongWeipeng <hongweichen8888@sina.com>2019-09-08 10:15:56 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2019-09-08 10:15:56 (GMT)
commit3c87a667bb367ace1de6bd1577fdb4f66947da52 (patch)
treee5fd31e977fc7d8041cb85c432de6715b055d55d /Lib/test/test_list.py
parent32a960f8e1015b64b4b955b3d62920c5903d4c6f (diff)
downloadcpython-3c87a667bb367ace1de6bd1577fdb4f66947da52.zip
cpython-3c87a667bb367ace1de6bd1577fdb4f66947da52.tar.gz
cpython-3c87a667bb367ace1de6bd1577fdb4f66947da52.tar.bz2
bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)
This is a complement to PR 13375.
Diffstat (limited to 'Lib/test/test_list.py')
-rw-r--r--Lib/test/test_list.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_list.py b/Lib/test/test_list.py
index c5002b1..fe4b2cd 100644
--- a/Lib/test/test_list.py
+++ b/Lib/test/test_list.py
@@ -150,6 +150,11 @@ class ListTest(list_tests.CommonTest):
a[:] = data
self.assertEqual(list(it), [])
+ def test_step_overflow(self):
+ a = [0, 1, 2, 3, 4]
+ a[1::sys.maxsize] = [0]
+ self.assertEqual(a[3::sys.maxsize], [3])
+
def test_no_comdat_folding(self):
# Issue 8847: In the PGO build, the MSVC linker's COMDAT folding
# optimization causes failures in code that relies on distinct