summaryrefslogtreecommitdiff
path: root/re.c
diff options
context:
space:
mode:
authortmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 23:30:25 +0000
committertmm1 <tmm1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-11-26 23:30:25 +0000
commitcbb56e30a4bc3d0f1446bdd3fb41f14a362e94fb (patch)
tree9fd90cc05e34b44c654ff7590854ca0f8f7be414 /re.c
parent599c3a92452995f897b03f68f3f7e86d62dc9cf9 (diff)
* compile.c: Use rb_fstring() to de-duplicate string literals in code. [ruby-core:58599] [Bug #9159] [ruby-core:54405]
* iseq.c (prepare_iseq_build): De-duplicate iseq labels and source locations. * re.c (rb_reg_initialize): Use rb_fstring() for regex string. * string.c (rb_fstring): Handle non-string and already-fstr arguments. * vm_eval.c (eval_string_with_cref): De-duplicate eval source filename. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
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;
}