summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-27 16:34:57 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-10-27 16:34:57 +0000
commit15270f48a9f3ccd7e57798d7eff4dd8d5d83c259 (patch)
treec71e68afd0789249aaed7cefb3dd2abcd6d79bc8 /compile.c
parent5a176b75b1187cbd3861c387bde65ff66396a07c (diff)
compile.c: stop modifying NODE tree
This fixes some modification remained in r60479 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60487 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/compile.c b/compile.c
index 8c295de00c..f53f3c1cec 100644
--- a/compile.c
+++ b/compile.c
@@ -5671,8 +5671,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
node->nd_args == NULL &&
ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- VALUE str = rb_fstring(node->nd_recv->nd_lit);
- iseq_add_mark_object(iseq, str);
+ VALUE str = freeze_literal(iseq, node->nd_recv->nd_lit);
if (node->nd_mid == idUMinus) {
ADD_INSN1(ret, line, opt_str_uminus, str);
}
@@ -5692,8 +5691,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
nd_type(node->nd_args->nd_head) == NODE_STR &&
ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction) {
- VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
- node->nd_args->nd_head->nd_lit = str;
+ VALUE str = freeze_literal(iseq, node->nd_args->nd_head->nd_lit);
CHECK(COMPILE(ret, "recv", node->nd_recv));
ADD_INSN3(ret, line, opt_aref_with,
new_callinfo(iseq, idAREF, 1, 0, NULL, FALSE),
@@ -6743,9 +6741,7 @@ iseq_compile_each0(rb_iseq_t *iseq, LINK_ANCHOR *const ret, const NODE *node, in
ISEQ_COMPILE_DATA(iseq)->current_block == NULL &&
ISEQ_COMPILE_DATA(iseq)->option->specialized_instruction)
{
- VALUE str = rb_fstring(node->nd_args->nd_head->nd_lit);
- node->nd_args->nd_head->nd_lit = str;
- iseq_add_mark_object(iseq, str);
+ VALUE str = freeze_literal(iseq, node->nd_args->nd_head->nd_lit);
CHECK(COMPILE(ret, "recv", node->nd_recv));
CHECK(COMPILE(ret, "value", node->nd_args->nd_next->nd_head));
if (!popped) {