aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/string.c b/string.c
index 1a1b9fd6ed..df7e81410a 100644
--- a/string.c
+++ b/string.c
@@ -305,7 +305,8 @@ fstr_update_callback(st_data_t *key, st_data_t *value, st_data_t arg, int existi
OBJ_FREEZE_RAW(str);
}
else {
- str = str_new_frozen(rb_cString, str);
+ if (!OBJ_FROZEN(str))
+ str = str_new_frozen(rb_cString, str);
if (STR_SHARED_P(str)) { /* str should not be shared */
/* shared substring */
str_make_independent(str);