Repository navigation
Conversation
RSTRING_LEN returns rb_len_t on Ruby master, so the variables receiving it follow. Older Rubies get a long typedef and build as before. https://bugs.ruby-lang.org/issues/22400 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The column is a character offset counted by rb_enc_strlen(), which returns rb_len_t. The line number stays long. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
These lengths come from pointer differences and go to functions that take rb_len_t, so they no longer pass through long on the way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Ruby declares it with an rb_len_t count, and a mismatching definition fails builds where the fallback is compiled against those headers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An int index overflows on an Array longer than INT_MAX, which LP64 and now mswin can hold. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ruby master added
rb_len_tas the type of String and Array lengths. It islongeverywhere today, and https://bugs.ruby-lang.org/issues/22400 proposes making it 64-bit on mswin, wherelongis 32-bit. Alongthat holds a string length there would truncate strings of 2GiB or more.This changes the lengths the extension reads from
RSTRING_LENandRSTRING_GETMEM, the lengths it passes to String constructors, and the column ofJSON::ParserErrortorb_len_t. Rubies withoutHAVE_RB_LEN_Tget alongtypedef, so nothing changes there.Generated with Claude Code