diff options
Diffstat (limited to 'compile.c')
-rw-r--r-- | compile.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -520,9 +520,10 @@ rb_iseq_compile_node(VALUE self, NODE *node) } } } - else if (nd_type(node) == NODE_IFUNC) { + else if (RB_TYPE_P((VALUE)node, T_IMEMO)) { + const struct vm_ifunc *ifunc = (struct vm_ifunc *)node; /* user callback */ - (*node->nd_cfnc)(iseq, ret, node->nd_tval); + (*ifunc->func)(iseq, ret, ifunc->data); } else { switch (iseq->type) { @@ -5396,7 +5397,7 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) */ int is_index = iseq->is_size++; VALUE once_iseq = NEW_CHILD_ISEQVAL( - NEW_IFUNC(build_postexe_iseq, node->nd_body), + (NODE *)IFUNC_NEW(build_postexe_iseq, node->nd_body), make_name_for_block(iseq), ISEQ_TYPE_BLOCK, line); ADD_INSN2(ret, line, once, once_iseq, INT2FIX(is_index)); @@ -6314,7 +6315,7 @@ method_for_self(VALUE name, VALUE arg, rb_insn_func_t func, acc.arg = arg; acc.func = func; acc.line = caller_location(&path, &absolute_path); - return rb_iseq_new_with_opt(NEW_IFUNC(build, (VALUE)&acc), + return rb_iseq_new_with_opt((NODE *)IFUNC_NEW(build, (VALUE)&acc), rb_sym2str(name), path, absolute_path, INT2FIX(acc.line), 0, ISEQ_TYPE_METHOD, 0); } |