ECL_STACK_FRAME_VARARGS_BEGIN: fix off-by-one error

We allocate arguments on a heap when number of them exceeds
ECL_C_ARGUMENTS_LIMIT. Was:

  if (narg <  ECL_C_ARGUMENTS_LIMIT) ... else ..

should be

  if (narg <= ECL_C_ARGUMENTS_LIMIT) ... else ..

It is a partial fix for #513 (solves a segfault).
This commit is contained in:
Daniel Kochmański 2019-07-02 10:52:56 +02:00
parent faca0641f9
commit 5986aee429

View file

@ -182,7 +182,7 @@ extern cl_object si_constant_form_value _ECL_ARGS((cl_narg narg, cl_object form,
frame->frame.t = t_frame; \
frame->frame.env = env; \
frame->frame.size = narg; \
if (narg < ECL_C_ARGUMENTS_LIMIT) { \
if (narg <= ECL_C_ARGUMENTS_LIMIT) { \
cl_object *p = frame->frame.base = env->values; \
va_list args; \
va_start(args, lastarg); \