fix wcm on error in let's

Repairs a problem with 8190a7730d, which can incorerctly
move an erroring experssion into tail position.
This commit is contained in:
Gustavo Massaccesi 2017-01-20 18:14:38 -03:00 committed by Matthew Flatt
parent 8190a7730d
commit d1ba9fbb6e
2 changed files with 15 additions and 1 deletions

View File

@ -3893,6 +3893,20 @@
(test-comp '(letrec-values ([(x y) (error "oops")]) 11)
'(error "oops"))
(test-comp '(with-continuation-mark
'x 'y
(let-values ([() (with-continuation-mark
'x 'z
(error "oops"))])
11))
'(with-continuation-mark
'x 'y
(begin0
(with-continuation-mark
'x 'z
(error "oops"))
(void))))
(test-comp `(module m racket/base
(define x 5)
(set! x 3)

View File

@ -7850,7 +7850,7 @@ static Scheme_Object *optimize_lets(Scheme_Object *form, Optimize_Info *info, in
if (!found_escapes) {
body = scheme_optimize_expr(body, body_info, scheme_optimize_tail_context(context));
} else {
body = escape_body;
body = ensure_noncm(escape_body);
body_info->single_result = 1;
body_info->preserves_marks = 1;
body_info->escapes = 1;