fix optimizer bug
Closes #1461 Thanks to Gustavo for tracking down the problem.
This commit is contained in:
parent
cfb2a7aa32
commit
2174f4a029
|
@ -6228,7 +6228,17 @@
|
||||||
(write (compile e) o)
|
(write (compile e) o)
|
||||||
(parameterize ([read-accept-compiled #t])
|
(parameterize ([read-accept-compiled #t])
|
||||||
(eval (read (open-input-bytes (get-output-bytes o)))))
|
(eval (read (open-input-bytes (get-output-bytes o)))))
|
||||||
((dynamic-require ''uses-mutator-with-an-auto-field 'f) #f))
|
((dynamic-require ''uses-mutator-with-an-auto-field 'f) #f))
|
||||||
|
|
||||||
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
;; Make sure that the optimizer doesn't discard a known error on the
|
||||||
|
;; right-hand side of a `letrec`
|
||||||
|
|
||||||
|
(err/rt-test
|
||||||
|
(letrec-values ([() (list (3) the-val)]
|
||||||
|
[(the-val) 42])
|
||||||
|
777)
|
||||||
|
exn:fail:contract?)
|
||||||
|
|
||||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||||
|
|
||||||
|
|
|
@ -7136,7 +7136,7 @@ static Scheme_Object *optimize_lets(Scheme_Object *form, Optimize_Info *info, in
|
||||||
(values (if id e1 e2) ...) and then split the values call, since
|
(values (if id e1 e2) ...) and then split the values call, since
|
||||||
duplicating the id use and test is likely to pay off. */
|
duplicating the id use and test is likely to pay off. */
|
||||||
if ((pre_body->count != 1)
|
if ((pre_body->count != 1)
|
||||||
&& (found_escapes
|
&& ((!is_rec && found_escapes)
|
||||||
|| (is_values_apply(value, pre_body->count, rhs_info, merge_skip_vars, 1)
|
|| (is_values_apply(value, pre_body->count, rhs_info, merge_skip_vars, 1)
|
||||||
&& ((!is_rec && no_mutable_bindings(pre_body))
|
&& ((!is_rec && no_mutable_bindings(pre_body))
|
||||||
/* If the right-hand side is omittable, then there are
|
/* If the right-hand side is omittable, then there are
|
||||||
|
|
Loading…
Reference in New Issue
Block a user