Add MRB_TT_PROC check to OP_SUPER as well; fix #3432

parent 76135e75
...@@ -1366,11 +1366,22 @@ RETRY_TRY_BLOCK: ...@@ -1366,11 +1366,22 @@ RETRY_TRY_BLOCK:
ci->mid = mid; ci->mid = mid;
ci->proc = m; ci->proc = m;
ci->stackent = mrb->c->stack; ci->stackent = mrb->c->stack;
{
int bidx;
mrb_value blk;
if (n == CALL_MAXARGS) { if (n == CALL_MAXARGS) {
ci->argc = -1; ci->argc = -1;
bidx = a+2;
} }
else { else {
ci->argc = n; 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->target_class = c;
ci->pc = pc + 1; ci->pc = pc + 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment