Permalink
Browse files

Always keep block argument space in stack; fix #3469

  • Loading branch information...
matz committed Feb 27, 2017
1 parent 83a6c0e commit 736be0e98b9e1136a4dc7cb2dd05e1f33728f767
Showing with 1 addition and 3 deletions.
  1. +1 −3 src/vm.c
View
@@ -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);
@@ -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++;
}

0 comments on commit 736be0e

Please sign in to comment.