Skip to content

Use rb_len_t for String lengths and Array indices - #1122

Merged
rhenium merged 2 commits into
ruby:masterfrom
rhenium:ky/rb_len_t
Oct 11, 2026
Merged

rhenium merged 2 commits into
ruby:masterfrom
rhenium:ky/rb_len_t

Conversation

@rhenium

@rhenium rhenium commented Oct 11, 2026

Copy link
Copy Markdown
Member

Ruby 4.1 will change String and Array lengths from long to rb_len_t. See https://bugs.ruby-lang.org/issues/22400 for details.

hsbt and others added 2 commits October 11, 2026 11:06
Lengths passed to OpenSSL functions that take a long, such as the d2i_* decoders, stay as they are. It falls back to long on Ruby versions that do not define HAVE_RB_LEN_T.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

(cherry picked from commit ruby/ruby@829e47d)
Update the remaining uses of long with rb_len_t. See
https://bugs.ruby-lang.org/issues/22400 for details.
@rhenium

rhenium commented Oct 11, 2026

Copy link
Copy Markdown
Member Author

CI is failing because the Ruby master don't have rb_len2long() yet.

@rhenium
rhenium merged commit c1fef6f into ruby:master Oct 11, 2026
43 of 48 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