Skip to content

Clear flags on interpolated strings#3606

Merged
tenderlove merged 1 commit intoruby:mainfrom
tenderlove:clear-flags
Jul 21, 2025
Merged

Clear flags on interpolated strings#3606
tenderlove merged 1 commit intoruby:mainfrom
tenderlove:clear-flags

Conversation

@tenderlove
Copy link
Member

When inner strings aren't frozen, we need to clear the flags on interpolated string nodes so that we don't emit wrong instructions.

The compiler is currently incorrectly emitting frozen strings because the parser is erroneously declaring interpolated strings as "frozen". We need to fix this behavior in the parser so we can fix the compiler in CRuby. This patch is a partial fix for this bug

When inner strings aren't frozen, we need to clear the flags on
interpolated string nodes so that we don't emit wrong instructions.

The compiler is currently incorrectly emitting frozen strings because
the parser is erroneously declaring interpolated strings as "frozen".
We need to fix this behavior in the parser so we can fix the compiler in
CRuby.  This patch is a partial fix for [this bug](https://bugs.ruby-lang.org/issues/21187)
@tenderlove tenderlove merged commit 4052d93 into ruby:main Jul 21, 2025
58 checks passed
@tenderlove tenderlove deleted the clear-flags branch July 21, 2025 23:04
tenderlove added a commit to tenderlove/ruby that referenced this pull request Jul 22, 2025
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  ruby/prism#3606

[Bug #21187]
tenderlove added a commit to tenderlove/ruby that referenced this pull request Jul 22, 2025
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  ruby/prism#3606

[Bug #21187]
tenderlove added a commit to ruby/ruby that referenced this pull request Jul 22, 2025
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  ruby/prism#3606

[Bug #21187]
k0kubun added a commit to k0kubun/prism that referenced this pull request Sep 12, 2025
This reverts commit 4052d93, reversing
changes made to 47143d1.
k0kubun pushed a commit to k0kubun/ruby that referenced this pull request Dec 8, 2025
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  ruby/prism#3606

[Bug #21187]
k0kubun pushed a commit to k0kubun/ruby that referenced this pull request Dec 8, 2025
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  ruby/prism#3606

[Bug #21187]
k0kubun pushed a commit to ruby/ruby that referenced this pull request Dec 8, 2025
Strings concatenated with backslash may end up being frozen when they
shouldn't be.  This commit fixes the issue.  It required a change
upstream in Prism, but also a change to the Prism compiler in CRuby.

  ruby/prism#3606

[Bug #21187]
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.

3 participants