aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authorJean Boussier <byroot@ruby-lang.org>2024-04-16 15:30:00 +0200
committerJean Boussier <jean.boussier@gmail.com>2024-04-16 17:20:35 +0200
commitf06670c5a2a1daa6595018858d5cfa429a8aeae6 (patch)
treef41c57d0089600f9faf5379d61d0aad6fbbaadee /string.c
parent7380e3d30ff3d33fa7dd3756929e5718be665bba (diff)
downloadruby-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/string.c b/string.c
index 040228844d..83bb91f17b 100644
--- a/string.c
+++ b/string.c
@@ -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;