diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1363,6 +1363,7 @@ rb_str_resurrect(VALUE str) * times (and call many realloc). */ +static inline void str_modifiable(VALUE str); static VALUE rb_str_init(int argc, VALUE *argv, VALUE str) { @@ -1414,6 +1415,9 @@ rb_str_init(int argc, VALUE *argv, VALUE str) } else if (n == 1) { StringValue(orig); + if (OBJ_FROZEN(str)) { + rb_error_frozen_object(str); + } str_replace(str, orig); } return str; |