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

Infinite loop in Range#each #3489

clayton-shopify opened this Issue Mar 8, 2017 · 0 comments


None yet
1 participant

clayton-shopify commented Mar 8, 2017

The following input results in an infinite loop:


This occurs because Range#each uses succ to advance to the next value and 'Z'.succ produces "AA" instead of "[".

MRI produces the expected result:

irb(main):001:0> ('A'..'a').to_a
=> ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "[", "\\", "]", "^", "_", "`", "a"]

This issue was reported by

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment