futures: fix a problem related to lightweight continuations
The mark-stack counter needs to be updated even if there are no entries to add to the mark stack.
This commit is contained in:
parent
2dd9a43d1b
commit
1d8f5279bd
|
@ -7065,8 +7065,12 @@ static Scheme_Object *continuation_marks(Scheme_Thread *p,
|
||||||
nt = NULL;
|
nt = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (first && (first_cmpos < first->pos))
|
if (first && (first_cmpos < first->pos)) {
|
||||||
scheme_signal_error("internal error: bad mark-stack position");
|
/* Don't use scheme_signal_error(), because that will try to get
|
||||||
|
a continuation mark... */
|
||||||
|
scheme_log_abort("internal error: bad mark-stack position");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
set = MALLOC_ONE_TAGGED(Scheme_Cont_Mark_Set);
|
set = MALLOC_ONE_TAGGED(Scheme_Cont_Mark_Set);
|
||||||
set->so.type = scheme_cont_mark_set_type;
|
set->so.type = scheme_cont_mark_set_type;
|
||||||
|
@ -8102,11 +8106,13 @@ Scheme_Lightweight_Continuation *scheme_restore_lightweight_continuation_marks(S
|
||||||
Scheme_Cont_Mark *seg;
|
Scheme_Cont_Mark *seg;
|
||||||
|
|
||||||
cm_len = lw->saved_lwc->cont_mark_stack_end - lw->saved_lwc->cont_mark_stack_start;
|
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) {
|
if (cm_len) {
|
||||||
/* install captured continuation marks, adjusting the pos
|
/* install captured continuation marks, adjusting the pos
|
||||||
to match the new context: */
|
to match the new context: */
|
||||||
seg = lw->cont_mark_stack_slice;
|
seg = lw->cont_mark_stack_slice;
|
||||||
cm_pos_delta = MZ_CONT_MARK_POS + 2 - lw->saved_lwc->cont_mark_pos_start;
|
|
||||||
for (i = 0; i < cm_len; i++) {
|
for (i = 0; i < cm_len; i++) {
|
||||||
MZ_CONT_MARK_POS = seg[i].pos + cm_pos_delta;
|
MZ_CONT_MARK_POS = seg[i].pos + cm_pos_delta;
|
||||||
#ifdef MZ_USE_FUTURES
|
#ifdef MZ_USE_FUTURES
|
||||||
|
@ -8117,7 +8123,6 @@ Scheme_Lightweight_Continuation *scheme_restore_lightweight_continuation_marks(S
|
||||||
lw = (Scheme_Lightweight_Continuation *)jit_future_storage[2];
|
lw = (Scheme_Lightweight_Continuation *)jit_future_storage[2];
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
MZ_CONT_MARK_POS = lw->saved_lwc->cont_mark_pos_end + cm_pos_delta;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return lw;
|
return lw;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user