[uim-commit] r2617 - branches/r5rs/sigscheme

kzk at freedesktop.org kzk at freedesktop.org
Fri Dec 16 15:59:13 PST 2005


Author: kzk
Date: 2005-12-16 15:59:09 -0800 (Fri, 16 Dec 2005)
New Revision: 2617

Modified:
   branches/r5rs/sigscheme/eval.c
Log:
* sigscheme/eval.c
  - (scm_s_cond_internal): don't pass the function to the
    macro as an argument.


Modified: branches/r5rs/sigscheme/eval.c
===================================================================
--- branches/r5rs/sigscheme/eval.c	2005-12-16 23:30:12 UTC (rev 2616)
+++ branches/r5rs/sigscheme/eval.c	2005-12-16 23:59:09 UTC (rev 2617)
@@ -1008,10 +1008,16 @@
         if (EQ(test, SYM_ELSE)) {
             ASSERT_NO_MORE_ARG(args);
         } else {
-            if (VALIDP(case_key))
-                test = (NFALSEP(scm_p_memv(case_key, test))) ? case_key : SCM_FALSE;
-            else
+            if (VALIDP(case_key)) {
+                /* Don't pass the scm_p_memv to the NFALSEP macro as an
+                 * argument (e.g. NFALSEP(scm_p_memv(key, test))), because
+                 * there's an possibility that scm_p_memv is called multiple
+                 * times after the macro expantion. */
+                test = scm_p_memv(case_key, test);
+                test = (NFALSEP(test)) ? case_key : SCM_FALSE;
+            } else {
                 test = EVAL(test, env);
+            }
         }
 
         if (NFALSEP(test)) {



More information about the uim-commit mailing list