Corrects the soundness bug issue 97: we need to do the singular context

code at assignment positions.
This commit is contained in:
Danny Yoo 2013-03-08 18:40:35 -07:00
parent af894366d3
commit 9271b7df90

View File

@ -1922,19 +1922,25 @@
(end-with-linkage (end-with-linkage
linkage linkage
cenv cenv
(compile (InstallValue-body exp) (append-instruction-sequences
(compile (InstallValue-body exp)
cenv cenv
target target
(make-NextLinkage 0)))] (make-NextLinkage 0))
(make-AssignImmediate target (make-Const (void)))
(emit-singular-context linkage)))]
[(= count 1) [(= count 1)
(append-instruction-sequences (append-instruction-sequences
(end-with-linkage (end-with-linkage
linkage linkage
cenv cenv
(compile (InstallValue-body exp) (append-instruction-sequences
cenv (compile (InstallValue-body exp)
(make-EnvLexicalReference (InstallValue-depth exp) (InstallValue-box? exp)) cenv
(make-NextLinkage 1))))] (make-EnvLexicalReference (InstallValue-depth exp) (InstallValue-box? exp))
(make-NextLinkage 1))
(make-AssignImmediate target (make-Const (void)))
(emit-singular-context linkage))))]
[else [else
(end-with-linkage (end-with-linkage
linkage linkage
@ -1957,7 +1963,9 @@
(cons (make-Reg 'val) (cons (make-Reg 'val)
(build-list (sub1 count) (lambda: ([i : Natural]) (build-list (sub1 count) (lambda: ([i : Natural])
(make-EnvLexicalReference i #f)))))) (make-EnvLexicalReference i #f))))))
(make-PopEnvironment (make-Const (sub1 count)) (make-Const 0))))])))) (make-PopEnvironment (make-Const (sub1 count)) (make-Const 0))
(make-AssignImmediate target (make-Const (void)))
(emit-singular-context linkage)))]))))
@ -2116,7 +2124,8 @@
;; Finally, set the target to void. ;; Finally, set the target to void.
(make-AssignImmediate target (make-Const (void))))))) (make-AssignImmediate target (make-Const (void)))
(emit-singular-context linkage)))))