Skip to content

Use rb_len_t for String lengths in erb/escape - #153

Merged
byroot merged 1 commit into
masterfrom
claude/optimistic-chaum-f0640d
Oct 11, 2026
Merged

byroot merged 1 commit into
masterfrom
claude/optimistic-chaum-f0640d

Conversation

@hsbt

@hsbt hsbt commented Oct 11, 2026

Copy link
Copy Markdown
Member

Ruby master now defines rb_len_t as the type for String and Array lengths, and RSTRING_LEN returns it (https://bugs.ruby-lang.org/issues/22400). escaped_length still held the length and its overflow limit as long. This switches them to rb_len_t and RB_LEN_MAX.

On Ruby versions without HAVE_RB_LEN_T, a fallback defines rb_len_t as long, so behavior does not change there. I ran rake compile and rake test on mswin with Ruby 3.3.12 and 4.1.0dev, which both use the fallback.

Generated with Claude Code

It falls back to long on Ruby versions that do not define HAVE_RB_LEN_T, so the change also builds there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@byroot
byroot merged commit 34ce73a into master Oct 11, 2026
16 checks passed
@byroot
byroot deleted the claude/optimistic-chaum-f0640d branch October 11, 2026 06:55
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