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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix String#to_i with leading zero and underscores #7934

Merged
merged 2 commits into from Sep 10, 2023

Conversation

headius
Copy link
Member

@headius headius commented Sep 10, 2023

Logic here is intended to bail out when the leading digit is 0 and there are two or more consecutive underscores, but it appears it was ported incorrectly (us += 0 馃え) resulting in it bailing out after ANY second underscore.

Fixes #7749.

We're only supposed to bail out on 2 or more consecutive
underscores. Probably ported wrong since us += 0 makes 0 sense.

Fixes jruby#7749
Specifically for cases with leading zeros, which falls into logic
in CRuby that ignores any number of non-consecutivee underscores
but bails out on two or more consecutive underscores.
@headius headius added this to the JRuby 9.3.11.0 milestone Sep 10, 2023
@headius headius merged commit 81883dd into jruby:jruby-9.3 Sep 10, 2023
51 of 53 checks passed
@headius headius deleted the string_to_i_underscores branch September 10, 2023 22:19
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.

None yet

1 participant