Stop marking chilled strings as frozen

They were initially made frozen to avoid false positives for cases such
as:

    str = str.dup if str.frozen?

But this may cause bugs and is generally confusing for users.

[Feature #20205]

Co-authored-by: Jean Boussier <byroot@ruby-lang.org>
This commit is contained in:
Étienne Barrié 2024-05-27 11:22:39 +02:00 committed by Jean Boussier
parent 2114d0af1e
commit 1376881e9a
13 changed files with 40 additions and 50 deletions

View file

@ -3884,11 +3884,6 @@ rb_error_frozen_object(VALUE frozen_obj)
{
rb_yjit_lazy_push_frame(GET_EC()->cfp->pc);
if (CHILLED_STRING_P(frozen_obj)) {
CHILLED_STRING_MUTATED(frozen_obj);
return;
}
VALUE debug_info;
const ID created_info = id_debug_created_info;
VALUE mesg = rb_sprintf("can't modify frozen %"PRIsVALUE": ",