* eval.c (SCM_APPLY): Fixed serious evaluator bug which returned
authorMikael Djurfeldt <djurfeldt@nada.kth.se>
Sun, 29 Aug 1999 01:28:49 +0000 (01:28 +0000)
committerMikael Djurfeldt <djurfeldt@nada.kth.se>
Sun, 29 Aug 1999 01:28:49 +0000 (01:28 +0000)
an ILOC instead of the value if a closure with a symbol as last
form was first called normally and then via `map'.

libguile/eval.c

index 81849a4..eb4518d 100644 (file)
@@ -3570,23 +3570,23 @@ tail:
       
       args = EXTEND_ENV (SCM_CAR (SCM_CODE (proc)), args, SCM_ENV (proc));
       proc = SCM_CDR (SCM_CODE (proc));
-      do
+    again:
+      arg1 = proc;
+      while (SCM_NNULLP (arg1 = SCM_CDR (arg1)))
        {
          if (SCM_IMP (SCM_CAR (proc)))
            {
              if (SCM_ISYMP (SCM_CAR (proc)))
                {
                  proc = scm_m_expand_body (proc, args);
-                 continue;
+                 goto again;
                }
-             arg1 = SCM_CAR (proc);
            }
          else
-           arg1 = SCM_CEVAL (SCM_CAR (proc), args);
-         proc = SCM_CDR (proc);
+           SCM_CEVAL (SCM_CAR (proc), args);
+         proc = arg1;
        }
-      while (SCM_NNULLP (proc));
-      RETURN (arg1);
+      RETURN (EVALCAR (proc, args));
     case scm_tc7_contin:
       SCM_ASRTGO (SCM_NULLP (args), wrongnumargs);
       scm_call_continuation (proc, arg1);