compiler: fix inlining of #%variable-reference

This commit is contained in:
Matthew Flatt 2015-01-13 06:45:59 -07:00
parent 486debd704
commit 719917f812
2 changed files with 12 additions and 1 deletions

View File

@ -4525,6 +4525,17 @@
(f i #f))))
(collect-garbage)
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Check that `#%variable-reference` inlines ok:
(let ([go
(lambda ()
(define foo 3)
(#%variable-reference foo))])
(define v (list (go) (go)))
(set! v v)
(test '(#t #t) map variable-reference? v))
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(report-errs)

View File

@ -4343,7 +4343,7 @@ ref_clone(int dup_ok, Scheme_Object *data, Optimize_Info *info, int delta, int c
if (!a) return NULL;
b = SCHEME_PTR2_VAL(data);
b = optimize_clone(dup_ok, a, info, delta, closure_depth);
b = optimize_clone(dup_ok, b, info, delta, closure_depth);
if (!b) return NULL;
naya = scheme_alloc_object();