mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
[3.12] gh-120384: Fix array-out-of-bounds crash in list_ass_subscript
(GH-120442) (#120825)
gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442)
(cherry picked from commit 8334a1b55c
)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
This commit is contained in:
parent
e58bece8ce
commit
d75eddcf36
4 changed files with 58 additions and 12 deletions
|
@ -191,6 +191,14 @@ class CommonTest(seq_tests.CommonTest):
|
|||
|
||||
self.assertRaises(TypeError, a.__setitem__)
|
||||
|
||||
def test_slice_assign_iterator(self):
|
||||
x = self.type2test(range(5))
|
||||
x[0:3] = reversed(range(3))
|
||||
self.assertEqual(x, self.type2test([2, 1, 0, 3, 4]))
|
||||
|
||||
x[:] = reversed(range(3))
|
||||
self.assertEqual(x, self.type2test([2, 1, 0]))
|
||||
|
||||
def test_delslice(self):
|
||||
a = self.type2test([0, 1])
|
||||
del a[1:2]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue