Fixed a bug in OP_SUPER block conversion; fix
@@ -1375,6 +1375,8 @@ RETRY_TRY_BLOCK:
mrb_sym mid = ci->mid;
int a = GETARG_A(i);
int n = GETARG_C(i);
+ mrb_value blk;
+ int bidx;
if (mid == 0 || !ci->target_class) {
mrb_value exc;
@@ -1414,23 +1416,10 @@ RETRY_TRY_BLOCK:
}
}
- /* push callinfo */
- ci = cipush(mrb);
- ci->mid = mid;
- ci->proc = m;
- ci->stackent = mrb->c->stack;
- ci->target_class = c;
- ci->pc = pc + 1;
- {
- 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];
@@ -1440,8 +1429,20 @@ RETRY_TRY_BLOCK:
ci->nregs = bidx+1;
}
regs[bidx] = mrb_convert_type(mrb, blk, MRB_TT_PROC, "Proc", "to_proc");
- ci = mrb->c->ci;
}
+
+ /* push callinfo */
+ ci = cipush(mrb);
+ ci->mid = mid;
+ ci->proc = m;
+ ci->stackent = mrb->c->stack;
+ ci->target_class = c;
+ ci->pc = pc + 1;
+ if (n == CALL_MAXARGS) {
+ ci->argc = -1;
+ }
+ else {
+ ci->argc = n;
}
/* prepare stack */
