Skip to content

Commit

Permalink
Fix an off-by-one error in interpreter's do_invoke (#54443)
Browse files Browse the repository at this point in the history
  • Loading branch information
fatteneder authored and KristofferC committed May 23, 2024
1 parent d4578a8 commit c0735fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/interpreter.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,10 +135,10 @@ static jl_value_t *do_invoke(jl_value_t **args, size_t nargs, interpreter_state
JL_GC_PUSHARGS(argv, nargs - 1);
size_t i;
for (i = 1; i < nargs; i++)
argv[i] = eval_value(args[i], s);
argv[i-1] = eval_value(args[i], s);
jl_method_instance_t *meth = (jl_method_instance_t*)args[0];
assert(jl_is_method_instance(meth));
jl_value_t *result = jl_invoke(argv[1], &argv[2], nargs - 2, meth);
jl_value_t *result = jl_invoke(argv[0], nargs == 2 ? NULL : &argv[1], nargs - 2, meth);
JL_GC_POP();
return result;
}
Expand Down

0 comments on commit c0735fe

Please sign in to comment.