Permalink
Browse files

Add MRB_TT_PROC check to OP_SUPER as well; fix #3432

  • Loading branch information...
matz committed Feb 8, 2017
1 parent 76135e7 commit af4d74fc7df9788a1c0013a4dc66e9bbac951b20
Showing with 16 additions and 5 deletions.
  1. +16 −5 src/vm.c
View
@@ -1366,11 +1366,22 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
ci->mid = mid;
ci->proc = m;
ci->stackent = mrb->c->stack;
if (n == CALL_MAXARGS) {
ci->argc = -1;
}
else {
ci->argc = n;
{
int bidx;
mrb_value blk;
if (n == CALL_MAXARGS) {
ci->argc = -1;
bidx = a+2;
}
else {
ci->argc = n;
bidx = a+n+1;
}
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");
}
}
ci->target_class = c;
ci->pc = pc + 1;

0 comments on commit af4d74f

Please sign in to comment.