Skip to content

Commit

Permalink
bytecode compiler: fix misuse of "optimize" mode on a "resolved" form
Browse files Browse the repository at this point in the history
Thanks to Robby for the test.
  • Loading branch information
mflatt committed Jan 21, 2017
1 parent 736cdfb commit aead07b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions pkgs/racket-test-core/tests/racket/optimize.rktl
Original file line number Diff line number Diff line change
Expand Up @@ -5759,6 +5759,12 @@
(parameterize ([read-accept-compiled #t])
(void (read (open-input-bytes (get-output-bytes o))))))

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check for an optimizer regresssion

(err/rt-test (+ (let-values (((x y) (let-values ((() 9)) 2))) x) (error))
exn:fail?)

;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

(report-errs)
2 changes: 1 addition & 1 deletion racket/src/racket/src/resolve.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static Scheme_Object *look_for_letv_change(Scheme_Sequence *s)
v = s->array[i];
if (SAME_TYPE(SCHEME_TYPE(v), scheme_let_value_type)) {
Scheme_Let_Value *lv = (Scheme_Let_Value *)v;
if (scheme_omittable_expr(lv->body, 1, -1, 0, NULL, NULL)) {
if (scheme_omittable_expr(lv->body, 1, -1, OMITTABLE_RESOLVED, NULL, NULL)) {
int esize = s->count - (i + 1);
int nsize = i + 1;
Scheme_Object *nv, *ev;
Expand Down

0 comments on commit aead07b

Please sign in to comment.