aboutsummaryrefslogtreecommitdiffstats
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/compile.c b/compile.c
index 5d219af65e..09e966d0f2 100644
--- a/compile.c
+++ b/compile.c
@@ -4977,12 +4977,14 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
LABEL *lend = NEW_LABEL(nd_line(node));
LABEL *lfin = NEW_LABEL(nd_line(node));
LABEL *ltrue = NEW_LABEL(nd_line(node));
- VALUE key = rb_sprintf("flipflag/%s-%p-%d",
- RSTRING_PTR(iseq->location.label), (void *)iseq,
- iseq->compile_data->flip_cnt++);
+ struct iseq_compile_data *data = iseq->local_iseq->compile_data;
+ rb_num_t cnt;
+ VALUE key;
+
+ if (!data) data = iseq->compile_data;
+ cnt = data->flip_cnt++ + DEFAULT_SPECIAL_VAR_COUNT;
+ key = INT2FIX(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);