1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-11 22:31:12 +02:00

(SCM_APPLY): For scm_tc7_subr_2o, throw wrong-num-args on 0

arguments or 3 or more arguments.  Previously 0 called proc with
SCM_UNDEFINED, and 3 or more silently used just the first 2.
This commit is contained in:
Kevin Ryde 2006-10-02 20:10:04 +00:00
parent 5ce6ee75df
commit 6f96fdfc89

View file

@ -4849,7 +4849,16 @@ tail:
switch (SCM_TYP7 (proc))
{
case scm_tc7_subr_2o:
args = scm_is_null (args) ? SCM_UNDEFINED : SCM_CAR (args);
if (SCM_UNBNDP (arg1))
scm_wrong_num_args (proc);
if (scm_is_null (args))
args = SCM_UNDEFINED;
else
{
if (! scm_is_null (SCM_CDR (args)))
scm_wrong_num_args (proc);
args = SCM_CAR (args);
}
RETURN (SCM_SUBRF (proc) (arg1, args));
case scm_tc7_subr_2:
if (scm_is_null (args) || !scm_is_null (SCM_CDR (args)))