Skip to content

Fix Repeat off-by-one error #535

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

Merged
merged 2 commits into from
Jul 1, 2022
Merged

Conversation

hamishknight
Copy link
Contributor

@hamishknight hamishknight commented Jul 1, 2022

Adjust the upper bound of the Range down when forming the quantification, as it expects an inclusive upper bound. Additionally, upgrade a couple of assertions to preconditions to ensure we don't silently fail byte code emission.

Resolves #478

Adjust the upper bound of the Range down when
forming the quantification, as it expects an
inclusive upper bound.
@hamishknight hamishknight requested a review from milseman July 1, 2022 12:00
Copy link
Member

@milseman milseman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Seems like we ought to crash in a release build
instead of potentially crashing during byte code
emission or silently failing to match.
@hamishknight
Copy link
Contributor Author

@swift-ci please test

@hamishknight hamishknight requested a review from rxwei July 1, 2022 14:08
@hamishknight hamishknight merged commit ed842cb into swiftlang:main Jul 1, 2022
@hamishknight hamishknight deleted the one-more branch July 1, 2022 18:38
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 this pull request may close these issues.

Off by one error for Repeat(...)
2 participants