From 20b834d84b205516668391da0f89812d7ca3b64d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Mon, 8 Jan 2007 05:57:47 +0000 Subject: [PATCH] fix bug in pruning saved runstacks and in sharing runstacks (when a barrier is present but too deep to prevent sharing) svn: r5259 --- src/mzscheme/src/fun.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/mzscheme/src/fun.c b/src/mzscheme/src/fun.c index 457670f06c..61d537ee4b 100644 --- a/src/mzscheme/src/fun.c +++ b/src/mzscheme/src/fun.c @@ -4179,7 +4179,7 @@ static Scheme_Cont *grab_continuation(Scheme_Thread *p, int for_prompt, int comp } scheme_cont_capture_count++; - if (!barrier_prompt || !barrier_prompt->is_barrier) { + if (!effective_barrier_prompt || !effective_barrier_prompt->is_barrier) { /* This continuation can be used by other threads, so we need to track ownership of the runstack */ if (!p->runstack_owner) { @@ -4211,9 +4211,12 @@ static Scheme_Cont *grab_continuation(Scheme_Thread *p, int for_prompt, int comp cont->runstack_copied = saved; if (!for_prompt && prompt) { /* Prune cont->runstack_saved to drop unneeded saves. */ - saved = clone_runstack_saved(cont->runstack_saved, - prompt->runstack_boundary_start, - NULL); + if (SAME_OBJ(prompt->runstack_boundary_start, MZ_RUNSTACK_START)) + saved = NULL; + else + saved = clone_runstack_saved(cont->runstack_saved, + prompt->runstack_boundary_start, + NULL); cont->runstack_saved = saved; } }