summaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-12 16:29:17 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-12 16:29:17 +0000
commit18929e2754a25a21a009656b1ee739499a7a8986 (patch)
tree50024bb1c287f384f27859a30960ddbe89d92c02 /compile.c
parentf7189473c18432139d3c597376097baf7ee5da15 (diff)
downloadruby-18929e2754a25a21a009656b1ee739499a7a8986.tar.gz
ruby-18929e2754a25a21a009656b1ee739499a7a8986.tar.xz
ruby-18929e2754a25a21a009656b1ee739499a7a8986.zip
* compile.c (iseq_set_sequence, compile_dstr_fragments),
(iseq_compile_each): hides other internal objects. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@22270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/compile.c b/compile.c
index 4a6078588..4244a56f2 100644
--- a/compile.c
+++ b/compile.c
@@ -1361,6 +1361,7 @@ iseq_set_sequence(rb_iseq_t *iseq, LINK_ANCHOR *anchor)
"duplicated when clause is ignored");
}
}
+ hide_obj(map);
generated_iseq[pos + 1 + j] = map;
iseq_add_mark_object(iseq, map);
break;
@@ -2121,7 +2122,8 @@ compile_dstr_fragments(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int *cntp
int cnt = 1;
debugp_param("nd_lit", lit);
- ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
+ hide_obj(lit);
+ ADD_INSN1(ret, nd_line(node), putobject, lit);
while (list) {
COMPILE(ret, "each string", list->nd_head);
@@ -2237,7 +2239,7 @@ compile_array_(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE* node_root,
rb_ary_push(ary, node->nd_head->nd_lit);
node = node->nd_next;
}
-
+ OBJ_FREEZE(ary);
iseq_add_mark_object_compile_time(iseq, ary);
ADD_INSN1(ret, nd_line(node_root), duparray, ary);
}
@@ -4369,6 +4371,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
break;
}
case NODE_XSTR:{
+ hide_obj(node->nd_lit);
ADD_CALL_RECEIVER(ret, nd_line(node));
ADD_INSN1(ret, nd_line(node), putobject, node->nd_lit);
ADD_CALL(ret, nd_line(node), ID2SYM(idBackquote), INT2FIX(1));
@@ -4660,6 +4663,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
RSTRING_PTR(iseq->name), (void *)iseq,
iseq->compile_data->flip_cnt++);
+ hide_obj(key);
iseq_add_mark_object_compile_time(iseq, key);
ADD_INSN2(ret, nd_line(node), getspecial, key, INT2FIX(0));
ADD_INSNL(ret, nd_line(node), branchif, lend);