diff options
Diffstat (limited to 'iseq.c')
-rw-r--r-- | iseq.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -199,17 +199,20 @@ set_relation(rb_iseq_t *iseq, const VALUE parent) /* set class nest stack */ if (type == ISEQ_TYPE_TOP) { /* toplevel is private */ - iseq->cref_stack = NEW_BLOCK(rb_cObject); + iseq->cref_stack = NEW_CREF(rb_cObject); + iseq->cref_stack->nd_omod = Qnil; iseq->cref_stack->nd_visi = NOEX_PRIVATE; if (th->top_wrapper) { - NODE *cref = NEW_BLOCK(th->top_wrapper); + NODE *cref = NEW_CREF(th->top_wrapper); + cref->nd_omod = Qnil; cref->nd_visi = NOEX_PRIVATE; cref->nd_next = iseq->cref_stack; iseq->cref_stack = cref; } } else if (type == ISEQ_TYPE_METHOD || type == ISEQ_TYPE_CLASS) { - iseq->cref_stack = NEW_BLOCK(0); /* place holder */ + iseq->cref_stack = NEW_CREF(0); /* place holder */ + iseq->cref_stack->nd_omod = Qnil; } else if (RTEST(parent)) { rb_iseq_t *piseq; @@ -1653,7 +1656,9 @@ rb_iseq_clone(VALUE iseqval, VALUE newcbase) iseq1->local_iseq = iseq1; } if (newcbase) { - iseq1->cref_stack = NEW_BLOCK(newcbase); + iseq1->cref_stack = NEW_CREF(newcbase); + iseq1->cref_stack->nd_omod = iseq0->cref_stack->nd_omod; + iseq1->cref_stack->nd_visi = iseq0->cref_stack->nd_visi; if (iseq0->cref_stack->nd_next) { iseq1->cref_stack->nd_next = iseq0->cref_stack->nd_next; } |