Permalink
Browse files

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
  • Loading branch information...
mflatt committed Oct 28, 2018
1 parent 2dc96b3 commit d1fe6a6e3e26df403f650ae821aa0adbd3df491d
Showing with 3 additions and 2 deletions.
  1. +2 −1 racket/collects/compiler/private/xform.rkt
  2. +1 −1 racket/src/racket/src/setjmpup.c
@@ -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)))
@@ -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

0 comments on commit d1fe6a6

Please sign in to comment.