From 8851726a92622b402b6655af6bcb075d8775f96a Mon Sep 17 00:00:00 2001 From: Danny Yoo Date: Sun, 26 Feb 2012 19:16:34 -0500 Subject: [PATCH] copmile-toplevel-ref and compile-toplevel-set know enough to see if we're mutating a module variable or not. --- compiler/compiler.rkt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/compiler/compiler.rkt b/compiler/compiler.rkt index f42b73f..3d1ef0f 100644 --- a/compiler/compiler.rkt +++ b/compiler/compiler.rkt @@ -491,7 +491,6 @@ (define (compile-toplevel-reference exp cenv target linkage) (define prefix (ensure-prefix (list-ref cenv (ToplevelRef-depth exp)))) (define prefix-element (list-ref (Prefix-names prefix) (ToplevelRef-pos exp))) - (let ([singular-context-check (emit-singular-context linkage)]) (end-with-linkage linkage cenv @@ -513,6 +512,9 @@ (: compile-toplevel-set (ToplevelSet CompileTimeEnvironment Target Linkage -> InstructionSequence)) ;; Compiles a toplevel mutation. (define (compile-toplevel-set exp cenv target linkage) + (define prefix (ensure-prefix (list-ref cenv (ToplevelSet-depth exp)))) + (define prefix-element (list-ref (Prefix-names prefix) (ToplevelSet-pos exp))) + (let ([lexical-pos (make-EnvPrefixReference (ToplevelSet-depth exp) (ToplevelSet-pos exp))]) (let ([get-value-code