fix problem with continuations
A tail call to a continuation could trigger a GC at a bad time while checking whether an escape variant of the contination is valid.
This commit is contained in:
parent
70ab6d482a
commit
829820e458
|
@ -1482,6 +1482,10 @@ Scheme_Object *scheme_jump_to_continuation(Scheme_Object *obj, int num_rands, Sc
|
||||||
Scheme_Prompt *prompt, *barrier_prompt;
|
Scheme_Prompt *prompt, *barrier_prompt;
|
||||||
int common_depth;
|
int common_depth;
|
||||||
|
|
||||||
|
/* Since scheme_escape_continuation_ok() may allocate... */
|
||||||
|
if (rands == p->tail_buffer)
|
||||||
|
make_tail_buffer_safe();
|
||||||
|
|
||||||
c = (Scheme_Cont *)obj;
|
c = (Scheme_Cont *)obj;
|
||||||
|
|
||||||
if (can_ec
|
if (can_ec
|
||||||
|
@ -1493,9 +1497,6 @@ Scheme_Object *scheme_jump_to_continuation(Scheme_Object *obj, int num_rands, Sc
|
||||||
GC_CAN_IGNORE Scheme_Object **vals;
|
GC_CAN_IGNORE Scheme_Object **vals;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (rands == p->tail_buffer)
|
|
||||||
make_tail_buffer_safe();
|
|
||||||
|
|
||||||
vals = MALLOC_N(Scheme_Object *, num_rands);
|
vals = MALLOC_N(Scheme_Object *, num_rands);
|
||||||
for (i = num_rands; i--; ) {
|
for (i = num_rands; i--; ) {
|
||||||
vals[i] = rands[i];
|
vals[i] = rands[i];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user