Skip to content

Commit

Permalink
vm.c: packed arguments length may be zero for send method.
Browse files Browse the repository at this point in the history
  • Loading branch information
matz committed Feb 18, 2022
1 parent 1e31424 commit 47068ae
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/vm.c
Expand Up @@ -689,9 +689,11 @@ mrb_f_send(mrb_state *mrb, mrb_value self)
regs = mrb->c->ci->stack+1;

if (n == 0) {
argnum_error:
mrb_argnum_error(mrb, 0, 1, -1);
}
else if (n == 15) {
if (RARRAY_LEN(regs[0]) == 0) goto argnum_error;
name = mrb_obj_to_sym(mrb, RARRAY_PTR(regs[0])[0]);
}
else {
Expand Down

0 comments on commit 47068ae

Please sign in to comment.