Skip to content
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

NewVectorIterator.slice susceptible to arithmetic overflow #12823

Closed
noresttherein opened this issue Jul 11, 2023 · 0 comments · Fixed by scala/scala#10518
Closed

NewVectorIterator.slice susceptible to arithmetic overflow #12823

noresttherein opened this issue Jul 11, 2023 · 0 comments · Fixed by scala/scala#10518

Comments

@noresttherein
Copy link

Reproduction steps

Scala version: 2.13.11

println(Vector(1, 2).iterator.slice(1, Int.MinValue).toList)

Problem

prints

List(2)
@SethTisue SethTisue added this to the Backlog milestone Aug 8, 2023
kapunga added a commit to kapunga/scala that referenced this issue Aug 28, 2023
Fixes scala/bug#12823
Adds a floor of 0 to the limit parameter of NewVectorIterator.slice.
This matches the base behavior of Iterator.slice and Vector.slace.
kapunga added a commit to kapunga/scala that referenced this issue Aug 28, 2023
Fixes scala/bug#12823
Adds a floor of 0 to the limit parameter of NewVectorIterator.slice.
This matches the base behavior of Iterator.slice and Vector.slice.
kapunga added a commit to kapunga/scala that referenced this issue Sep 26, 2023
Fixes scala/bug#12823
Adds a floor of 0 to the limit parameter of NewVectorIterator.slice.
This matches the base behavior of Iterator.slice and Vector.slice.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants