Skip to content

Keep Integer#to_json optimized and adapt the test#966

Merged
byroot merged 1 commit intoruby:masterfrom
eregon:alternative-test_broken_bignum
Mar 26, 2026
Merged

Keep Integer#to_json optimized and adapt the test#966
byroot merged 1 commit intoruby:masterfrom
eregon:alternative-test_broken_bignum

Conversation

@eregon
Copy link
Member

@eregon eregon commented Mar 26, 2026

  • Redefining Integer#to_s is bound to break many things (example), any non-segfault outcome should be acceptable. So adapt the test to just ensure it does not segfault.
  • Also redefining Kernel#String would also break with the previous code.

From #962

* Redefining Integer#to_s is bound to break many things,
  any non-segfault outcome should be acceptable.
  So adapt the test to just ensure it does not segfault.
* Also redefining Kernel#String would also break with the previous code.
@eregon eregon requested a review from byroot March 26, 2026 15:43
Copy link
Member

@byroot byroot left a comment

Choose a reason for hiding this comment

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

Fine by me. That test was added because 15 years ago redefining this method woulc crash the C extension. The exact error or even behavior doesn't matter much.

@byroot byroot merged commit ac0670b into ruby:master Mar 26, 2026
41 checks passed
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.

2 participants