From 478f3d64d974e5567641340b9cdf03243958e63d Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Fri, 11 Jan 2013 12:30:36 -0700 Subject: [PATCH] futures: bug fix The problem was in the handing of "lightweight continuations" used to represent suspended computations, and in particular the handling of continuation marks (such as the ones added by DrRacket's debugging mode). Unfortunately, I wasn't able to construct a simpler test case that triggers the problem. I think the number of installed continuation marks has to be just right, and there have to be some replacing marks, and a lightweight continuaiton has to be captured at the right time as a result of applying a previously captured continuation. Closes PR 13427 Merge to v5.3.2 (cherry picked from commit f93c6208148f60b37dfcc618372671feb733da5e) --- src/racket/src/fun.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/racket/src/fun.c b/src/racket/src/fun.c index 6eedeac953..3f4c91cccb 100644 --- a/src/racket/src/fun.c +++ b/src/racket/src/fun.c @@ -8522,7 +8522,6 @@ Scheme_Lightweight_Continuation *scheme_restore_lightweight_continuation_marks(S cm_len = lw->saved_lwc->cont_mark_stack_end - lw->saved_lwc->cont_mark_stack_start; cm_pos_delta = MZ_CONT_MARK_POS + 2 - lw->saved_lwc->cont_mark_pos_start; - MZ_CONT_MARK_POS = lw->saved_lwc->cont_mark_pos_end + cm_pos_delta; if (cm_len) { /* install captured continuation marks, adjusting the pos @@ -8540,6 +8539,8 @@ Scheme_Lightweight_Continuation *scheme_restore_lightweight_continuation_marks(S } } + MZ_CONT_MARK_POS = lw->saved_lwc->cont_mark_pos_end + cm_pos_delta; + return lw; }