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

kzk at freedesktop.org kzk at freedesktop.org
Sun Dec 4 14:11:01 PST 2005


Author: kzk
Date: 2005-12-04 14:10:57 -0800 (Sun, 04 Dec 2005)
New Revision: 2368

Modified:
   branches/r5rs/sigscheme/storage-continuation.c
Log:
* sigscheme/storage-continuation.c
  - (Scm_CallContinuation): avoid multiple calls of
    continuation_stack_unwind.


Modified: branches/r5rs/sigscheme/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/storage-continuation.c	2005-12-04 21:17:37 UTC (rev 2367)
+++ branches/r5rs/sigscheme/storage-continuation.c	2005-12-04 22:10:57 UTC (rev 2368)
@@ -307,31 +307,34 @@
 void Scm_CallContinuation(ScmObj cont, ScmObj ret)
 {
     struct continuation_frame *frame;
+#if SCM_NESTED_CONTINUATION_ONLY
+    ScmObj obj;
+#endif
+
     DECLARE_INTERNAL_FUNCTION("Scm_CallContinuation");
 
     frame = CONTINUATION_FRAME(cont);
+    if (frame == INVALID_CONTINUATION_OPAQUE)
+        ERR("Scm_CallContinuation: called expired continuation");
 
-    if (frame != INVALID_CONTINUATION_OPAQUE
 #if SCM_NESTED_CONTINUATION_ONLY
-        && CONTINUATIONP(continuation_stack_unwind(cont))
+    obj = continuation_stack_unwind(cont);
+    if (!CONTINUATIONP(obj))
+        ERR("Scm_CallContinuation: called expired continuation");
 #endif
-        )
-    {
-        if (VALUEPACKETP(ret))
-            ERR_OBJ("continuations take exactly one value but got", ret);
 
-        /*
-         * Don't refer cont because it may already be invalidated by
-         * continuation_stack_unwind().
-         */
-        exit_dynamic_extent(frame->dyn_ext);
+    if (VALUEPACKETP(ret))
+        ERR_OBJ("continuations take exactly one value but got", ret);
 
-        frame->ret_val = ret;
-        longjmp(frame->c_env, 1);
-        /* NOTREACHED */
-    } else {
-        ERR("Scm_CallContinuation: called expired continuation");
-    }
+    /*
+     * Don't refer cont because it may already be invalidated by
+     * continuation_stack_unwind().
+     */
+    exit_dynamic_extent(frame->dyn_ext);
+    
+    frame->ret_val = ret;
+    longjmp(frame->c_env, 1);
+    /* NOTREACHED */
 }
 
 /*============================================================================



More information about the uim-commit mailing list