Skip to content

Commit

Permalink
fix wcm on error in let's
Browse files Browse the repository at this point in the history
Repairs a problem with 8190a77, which can incorerctly
move an erroring experssion into tail position.
  • Loading branch information
gus-massa authored and mflatt committed Jan 20, 2017
1 parent 8190a77 commit d1ba9fb
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
14 changes: 14 additions & 0 deletions pkgs/racket-test-core/tests/racket/optimize.rktl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion racket/src/racket/src/optimize.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1ba9fb

Please sign in to comment.