Skip to content

ZJIT: Mark String#% as returning StringExact - #1088

Closed
femto wants to merge 1 commit into
Shopify:masterfrom
femto:zjit-string-format-stringexact
Closed

femto wants to merge 1 commit into
Shopify:masterfrom
femto:zjit-string-format-stringexact

Conversation

@femto

@femto femto commented Oct 22, 2026

Copy link
Copy Markdown

Fixes #1085

String#% (rb_str_format_m) always allocates its result with rb_str_buf_new in rb_str_format, so the result is a plain String even when the receiver is a subclass. This annotates it in cruby_methods.rs and adds an HIR opt test:

v25:StringExact = CCallWithFrame v11, :String#%@0x1040, v13

🤖 Generated with Claude Code

rb_str_format always allocates its result with rb_str_buf_new, so the
result is a plain String even when the receiver is a subclass.

Fixes Shopify#1085

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the jit label Oct 22, 2026
@femto
femto force-pushed the zjit-string-format-stringexact branch from 839938f to 4b3e94d Compare October 22, 2026 13:23
@tekknolagi

Copy link
Copy Markdown

PRs should be to ruby/ruby, not Shopify/ruby.

@tekknolagi tekknolagi closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ZJIT: Mark String#% as returning StringExact

2 participants