summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/re.c b/re.c
index a7074d8282..f69eb09b10 100644
--- a/re.c
+++ b/re.c
@@ -2460,8 +2460,7 @@ rb_reg_initialize(VALUE obj, const char *s, long len, rb_encoding *enc,
options & ARG_REG_OPTION_MASK, err,
sourcefile, sourceline);
if (!re->ptr) return -1;
- OBJ_WRITE(obj, &re->src, rb_enc_str_new(s, len, enc));
- OBJ_FREEZE(re->src);
+ OBJ_WRITE(obj, &re->src, rb_fstring(rb_enc_str_new(s, len, enc)));
RB_GC_GUARD(unescaped);
return 0;
}