Skip to content

Commit

Permalink
Always keep block argument space in stack; fix #3469
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Feb 27, 2017
1 parent 83a6c0e commit 736be0e
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,14 +1162,12 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
}
if (GET_OPCODE(i) != OP_SENDB) {
SET_NIL_VALUE(regs[bidx]);
bidx = 0;
}
else {
mrb_value blk = regs[bidx];
if (!mrb_nil_p(blk) && mrb_type(blk) != MRB_TT_PROC) {
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
}
bidx = 1;
}
c = mrb_class(mrb, recv);
m = mrb_method_search_vm(mrb, &c, mid);
Expand Down Expand Up @@ -1198,7 +1196,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
mrb_ary_unshift(mrb, regs[a+1], sym);
}
else {
value_move(regs+a+2, regs+a+1, n+bidx);
value_move(regs+a+2, regs+a+1, n+1);
regs[a+1] = sym;
n++;
}
Expand Down

0 comments on commit 736be0e

Please sign in to comment.