diff --git a/compile.c b/compile.c index 6757ea3..5a1e04b 100644 --- a/compile.c +++ b/compile.c @@ -4585,10 +4585,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) } #endif /* receiver */ - if (type == NODE_CALL) { + if (type == NODE_CALL && nd_type(node->nd_recv) != NODE_SELF) { COMPILE(recv, "recv", node->nd_recv); } - else if (type == NODE_FCALL || type == NODE_VCALL) { + else if (type == NODE_CALL || type == NODE_FCALL || type == NODE_VCALL) { ADD_CALL_RECEIVER(recv, line); } @@ -4606,6 +4606,10 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) debugp_param("call args argc", argc); debugp_param("call method", ID2SYM(mid)); + if (nd_type(node) == NODE_CALL && nd_type(node->nd_recv) == NODE_SELF) { + flag |= VM_CALL_FCALL; + } + switch (nd_type(node)) { case NODE_VCALL: flag |= VM_CALL_VCALL;