variable-reference->namespace: repair namespace availability

Internally, the namespace must be set to the returned one while making
it available. Otherwise, the current namespace can get mangled.

Closes #2067
This commit is contained in:
Matthew Flatt 2018-05-06 13:53:38 -06:00
parent 76c404dffc
commit f9821f9f15
2 changed files with 10 additions and 2 deletions

View File

@ -29,7 +29,8 @@
(define mpi (namespace-mpi ns))
(when (non-self-module-path-index? mpi)
;; Ensure that the module is available
(namespace-module-make-available! ns mpi (namespace-0-phase ns)))
(parameterize ([current-namespace ns])
(namespace-module-make-available! ns mpi (namespace-0-phase ns))))
ns)
(define (variable-reference->namespace* vr)

View File

@ -57814,8 +57814,15 @@ static const char *startup_source =
"(begin"
"(if(non-self-module-path-index? mpi_50)"
"(let-values()"
"(with-continuation-mark"
" parameterization-key"
"(extend-parameterization"
"(continuation-mark-set-first #f parameterization-key)"
" 1/current-namespace"
" ns_60)"
"(let-values()"
"(let-values(((ns4_1) ns_60)((mpi5_0) mpi_50)((temp6_5)(namespace-0-phase ns_60)))"
"(namespace-module-make-available!112.1 unsafe-undefined ns4_1 mpi5_0 temp6_5)))"
"(namespace-module-make-available!112.1 unsafe-undefined ns4_1 mpi5_0 temp6_5)))))"
"(void))"
" ns_60)))))))))"
"(define-values"