diff options
author | Jean Boussier <byroot@ruby-lang.org> | 2024-04-16 15:30:00 +0200 |
---|---|---|
committer | Jean Boussier <jean.boussier@gmail.com> | 2024-04-16 17:20:35 +0200 |
commit | f06670c5a2a1daa6595018858d5cfa429a8aeae6 (patch) | |
tree | f41c57d0089600f9faf5379d61d0aad6fbbaadee /string.c | |
parent | 7380e3d30ff3d33fa7dd3756929e5718be665bba (diff) | |
download | ruby-f06670c5a2a1daa6595018858d5cfa429a8aeae6.tar.gz |
Eliminate usage of OBJ_FREEZE_RAW
Previously it would bypass the `FL_ABLE` check, but
since shapes introduction, it started having a different
behavior than `OBJ_FREEZE`, as it would onyl set the `FL_FREEZE`
flag, but not update the shape.
I have no indication of this causing a bug yet, but it seems
like a trap waiting to happen.
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -379,7 +379,7 @@ fstr_update_callback(st_data_t *key, st_data_t *value, st_data_t data, int exist RSTRING(str)->len, ENCODING_GET(str)); } - OBJ_FREEZE_RAW(str); + OBJ_FREEZE(str); } else { if (!OBJ_FROZEN(str) || CHILLED_STRING_P(str)) { @@ -415,7 +415,7 @@ rb_fstring(VALUE str) bare = BARE_STRING_P(str); if (!bare) { if (STR_EMBED_P(str)) { - OBJ_FREEZE_RAW(str); + OBJ_FREEZE(str); return str; } @@ -432,7 +432,7 @@ rb_fstring(VALUE str) if (!bare) { str_replace_shared_without_enc(str, fstr); - OBJ_FREEZE_RAW(str); + OBJ_FREEZE(str); return str; } return fstr; |