summaryrefslogtreecommitdiff
path: root/compile.c
diff options
context:
space:
mode:
Diffstat (limited to 'compile.c')
-rw-r--r--compile.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/compile.c b/compile.c
index a30a98efdb..02f2214940 100644
--- a/compile.c
+++ b/compile.c
@@ -4285,8 +4285,16 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped)
ADD_INSN(ret, nd_line(node), putnil);
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);
+
+ if (flag & VM_CALL_ARGS_BLOCKARG_BIT) {
+ ADD_INSN1(ret, nd_line(node), topn, INT2FIX(1));
+ ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 3));
+ ADD_INSN (ret, nd_line(node), pop);
+ }
+ else {
ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 1));
}
+ }
else {
ADD_SEQ(ret, recv);
ADD_SEQ(ret, args);