Skip to content

SaturatedSliceIter::next has overflow bug #3468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
youknowone opened this issue Nov 28, 2021 · 3 comments · Fixed by #3472
Closed

SaturatedSliceIter::next has overflow bug #3468

youknowone opened this issue Nov 28, 2021 · 3 comments · Fixed by #3472

Comments

@youknowone
Copy link
Member

youknowone commented Nov 28, 2021

$ cargo run Lib/test/test_list.py -v -k test_extendedslicing

test_extendedslicing (__main__.ListTest) ... thread 'main' panicked at 'attempt to add with overflow', vm/src/builtins/slice.rs:377:9

Probably introduced in #3340

@Snowapril
Copy link
Contributor

cargo run Lib/test/test_userlist.py -v -k test_extendedslicing 

above one also panicked by same reasom

@Snowapril
Copy link
Contributor

a = self.type2test(range(10))
del a[9::1<<333]

These line make panicked

@Snowapril
Copy link
Contributor

Snowapril commented Nov 28, 2021

SaturatedSliceIter used for both set_slice and del_slice, but del_slice seems required different condition for iterating.
set_slice(subscript in cpython) loop with condition on slice length, but del_slice(ass_subscript in cpython) check current index is over stop or not.

qingshi163 added a commit to qingshi163/RustPython that referenced this issue Nov 28, 2021
youknowone added a commit that referenced this issue Nov 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants