repair allocation bug in delimited continuations

The repair is more precisely a repait to xform, which incorrectly
parsed a C function definition that starts "struct" as a struct
declaration. (The function starts "struct" because the return type is
"struct Scheme_Overflow_Jmp *".) Since the function wasn't recognized,
xform didn't convert it to cooperate with the garbage collector.

Closes #2341
This commit is contained in:
Matthew Flatt 2018-10-28 16:54:55 -06:00
parent 2dc96b365a
commit d1fe6a6e3e
2 changed files with 3 additions and 2 deletions

View File

@ -1808,7 +1808,8 @@
(define (struct-decl? e)
(and (memq (tok-n (car e)) '(struct enum))
(ormap braces? (cdr e))))
(ormap braces? (cdr e))
(not (function? e))))
(define (class-decl? e)
(memq (tok-n (car e)) '(class)))

View File

@ -590,7 +590,7 @@ struct Scheme_Overflow_Jmp *scheme_prune_jmpup(struct Scheme_Overflow_Jmp *jmp,
base = (char *)stack_boundary;
# else
delta = 0;
new_size = (intptr_t)stack_boundary - (intptr_t)jmp->cont.stack_from;
new_size = (intptr_t)stack_boundary XFORM_OK_MINUS (intptr_t)jmp->cont.stack_from;
base = jmp->cont.stack_from;
# endif