vm.c (mrb_ci_kdict): should return -1 when no kargs given; ref #5741

This commit is contained in:
Yukihiro "Matz" Matsumoto
2022-07-06 10:07:02 +09:00
parent 638356af03
commit 82a419cde3
+1
View File
@@ -482,6 +482,7 @@ mrb_funcall_id(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, ...)
static mrb_int
mrb_ci_kidx(const mrb_callinfo *ci)
{
if (ci->nk == 0) return -1;
return (ci->n == CALL_MAXARGS) ? 2 : ci->n + 1;
}