diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-08 16:22:24 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2021-12-08 16:22:24 +0900 |
| commit | 5bad1c742927bd8569575e2f3f955d08fd4f6e8a (patch) | |
| tree | 0f565e1328f5f5dfdfd5851e92041aada1c0b1c7 | |
| parent | 0b6b042fe8377a94451c013ea1c7150762adef18 (diff) | |
| download | mruby-5bad1c742927bd8569575e2f3f955d08fd4f6e8a.tar.gz mruby-5bad1c742927bd8569575e2f3f955d08fd4f6e8a.zip | |
vm.c: fix `mrb_ci_kidx`.
It used to return wrong value for 14 positional arguments.
| -rw-r--r-- | src/vm.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -394,10 +394,9 @@ mrb_funcall_id(mrb_state *mrb, mrb_value self, mrb_sym mid, mrb_int argc, ...) } 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 % 14) + 1; + return (ci->n == CALL_MAXARGS) ? 2 : ci->n + 1; } static mrb_int |
