vm.c: fix `mrb_ci_kidx`.

It used to return wrong value for 14 positional arguments.
parent 0b6b042f
...@@ -394,10 +394,9 @@ mrb_funcall_id(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, ...) ...@@ -394,10 +394,9 @@ mrb_funcall_id(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, ...)
} }
static mrb_int static mrb_int
mrb_ci_kidx(mrb_callinfo *ci) mrb_ci_kidx(const mrb_callinfo *ci)
{ {
if (ci->nk == 0) return -1; return (ci->n == CALL_MAXARGS) ? 2 : ci->n + 1;
return (ci->n % 14) + 1;
} }
static mrb_int static mrb_int
......
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