[uim-commit] r2369 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sun Dec 4 14:35:24 PST 2005
Author: yamaken
Date: 2005-12-04 14:35:19 -0800 (Sun, 04 Dec 2005)
New Revision: 2369
Modified:
branches/r5rs/sigscheme/storage-continuation.c
Log:
* sigscheme/storage-continuation.c
- (Scm_CallContinuation): Rewrite back to original logic of r2367 to
resurrect the succeed-case-centric control flow
Modified: branches/r5rs/sigscheme/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/storage-continuation.c 2005-12-04 22:10:57 UTC (rev 2368)
+++ branches/r5rs/sigscheme/storage-continuation.c 2005-12-04 22:35:19 UTC (rev 2369)
@@ -308,33 +308,34 @@
{
struct continuation_frame *frame;
#if SCM_NESTED_CONTINUATION_ONLY
- ScmObj obj;
+ ScmObj dst;
#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
- obj = continuation_stack_unwind(cont);
- if (!CONTINUATIONP(obj))
- ERR("Scm_CallContinuation: called expired continuation");
+ /* assign to temporary var to avoid duplicate eval in the macro */
+ && (dst = continuation_stack_unwind(cont), CONTINUATIONP(dst))
#endif
+ )
+ {
+ if (VALUEPACKETP(ret))
+ ERR_OBJ("continuations take exactly one value but got", ret);
- 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);
- /*
- * 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 */
+ frame->ret_val = ret;
+ longjmp(frame->c_env, 1);
+ /* NOTREACHED */
+ } else {
+ ERR("Scm_CallContinuation: called expired continuation");
+ }
}
/*============================================================================
More information about the uim-commit
mailing list