fix syntax-local-lift-values-expression

When lifts are captured as `let`, make sure the variable
bindings aren't reversed.
This commit is contained in:
Matthew Flatt 2016-08-07 12:06:36 -06:00
parent a229640251
commit 62b8f7aaa3
2 changed files with 24 additions and 1 deletions

View File

@ -1642,6 +1642,29 @@
(m (check) (check2)))
;; ----------------------------------------
;; Check that `syntax-local-lift-values-expression` works rigth when lifts
;; are converted to `let`; in particular, make sure the order is
;; right
(module uses-local-lift-values-at-expansion-time racket/base
(require (for-syntax racket/base))
(begin-for-syntax
(require (for-syntax racket/base))
(define-syntax (m stx)
#`(values #,@(syntax-local-lift-values-expression 3 #'(values 1 2 3)))))
(define-syntax (n stx)
(define-values (a b c) (m))
#`(list #,a #,b #,c))
(provide l)
(define l (n)))
(test '(1 2 3) dynamic-require ''uses-local-lift-values-at-expansion-time 'l)
;; ----------------------------------------
(report-errs)

View File

@ -978,7 +978,7 @@ void scheme_set_compilation_variables(Scheme_Comp_Env *frame, Scheme_IR_Local **
for (i = 0; i < count; i++) {
MZ_ASSERT(!frame->vars[i+pos]);
frame->vars[i+pos] = vars[i];
frame->vars[i+pos] = vars[count - i - 1];
}
}