mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
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:
parent
2114d0af1e
commit
1376881e9a
13 changed files with 40 additions and 50 deletions
5
error.c
5
error.c
|
@ -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": ",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue