From e37a4fbae1bdc6f6fb831bb1247b0d8746c2c967 Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Wed, 21 Feb 2001 20:14:47 +0000 Subject: [PATCH] * eval.c (scm_ceval, scm_deval): Check for wrong number of args before applying arrow procedure in `cond' and before applying receiver procedure in call-with-current-continuation. (scm_i_eval): Do not invoke scm_copy_tree in argument in SCM_XEVAL macro. The argument is expanded more than one time. --- libguile/eval.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libguile/eval.c b/libguile/eval.c index 016f37a46..5b15619a2 100644 --- a/libguile/eval.c +++ b/libguile/eval.c @@ -2005,6 +2005,8 @@ dispatch: SCM_ASRTGO (SCM_NIMP (proc), badfun); PREP_APPLY (proc, scm_cons (t.arg1, SCM_EOL)); ENTER_APPLY; + if (scm_badformalsp (proc, 1)) + goto umwrongnumargs; goto evap1; } } @@ -2215,6 +2217,8 @@ dispatch: SCM_ASRTGO (SCM_NIMP (proc), badfun); PREP_APPLY (proc, scm_cons (t.arg1, SCM_EOL)); ENTER_APPLY; + if (scm_badformalsp (proc, 1)) + goto umwrongnumargs; goto evap1; case (SCM_ISYMNUM (SCM_IM_DELAY)): @@ -3863,7 +3867,8 @@ scm_i_eval (SCM exp, SCM env) SCM transformer = scm_fluid_ref (SCM_CDR (scm_system_transformer)); if (SCM_NIMP (transformer)) exp = scm_apply (transformer, exp, scm_listofnull); - return SCM_XEVAL (scm_copy_tree (exp), env); + exp = scm_copy_tree (exp); + return SCM_XEVAL (exp, env); } SCM