aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-04 06:46:28 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-02-04 06:46:28 +0000
commit51f3f3219cf538a1fddbfcdd9b07c7fbceb90cfe (patch)
tree88a45741fd84cfac9dd27482c7addac31e3aea34 /re.c
parent54490af01ba605d3b2326bc16b9c31085b97f1ea (diff)
downloadruby-51f3f3219cf538a1fddbfcdd9b07c7fbceb90cfe.tar.gz
revert re.c in r53736
* re.c (rb_reg_initialize): must copy the source string content, it is not a static literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 're.c')
-rw-r--r--re.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/re.c b/re.c
index d4352d340d..69cbc687e7 100644
--- a/re.c
+++ b/re.c
@@ -2580,7 +2580,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;
- RB_OBJ_WRITE(obj, &re->src, rb_fstring_enc_new(s, len, enc));
+ RB_OBJ_WRITE(obj, &re->src, rb_fstring(rb_enc_str_new(s, len, enc)));
RB_GC_GUARD(unescaped);
return 0;
}