Skip to content

Conversation

headius
Copy link
Member

@headius headius commented Jul 1, 2025

Chilled strings are constructed much like frozen strings, reusing the same bytelist for each new instance. But unlike frozen strings, chilled strings may still be mutated for now. We mark all such strings as having a shared ByteList to ensure that it is copied before making modifications.

Fixes #8861

Chilled strings are constructed much like frozen strings, reusing
the same bytelist for each new instance. But unlike frozen strings,
chilled strings may still be mutated for now. We mark all such
strings as having a shared ByteList to ensure that it is copied
before making modifications.

Fixes jruby#8861
@headius headius force-pushed the restore_string_modify branch from e85b975 to 856e840 Compare July 1, 2025 18:12
@headius headius changed the title Restore modify check lost during refactoring Always set chilled strings as sharing bytelist Jul 1, 2025
@headius headius merged commit c7125e1 into jruby:master Jul 1, 2025
71 checks passed
@headius headius deleted the restore_string_modify branch July 1, 2025 18:40
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.

Using a string that has been mutated seems to result in a variable containing an unexpected value

1 participant