fix `namespace-attach-module{-declaration}' problem
Closes PR 12048
This commit is contained in:
parent
b972a0940d
commit
3b8d00029e
|
@ -174,6 +174,17 @@
|
||||||
|
|
||||||
(test 'va->ms dynamic-require ''va->ms 'modsrc)
|
(test 'va->ms dynamic-require ''va->ms 'modsrc)
|
||||||
|
|
||||||
|
;; ----------------------------------------
|
||||||
|
;; Check that `namespace-attach-module-declaration' doesn't
|
||||||
|
;; trigger the module-name resolver in the wrong namespace:
|
||||||
|
|
||||||
|
(let ()
|
||||||
|
(define ns0 (make-base-namespace))
|
||||||
|
(eval '(module sample racket (#%module-begin)) ns0)
|
||||||
|
(define ns1 (make-empty-namespace))
|
||||||
|
(parameterize ([current-namespace ns1])
|
||||||
|
(namespace-attach-module-declaration ns0 ''sample ns1)))
|
||||||
|
|
||||||
;; ----------------------------------------
|
;; ----------------------------------------
|
||||||
|
|
||||||
(report-errs)
|
(report-errs)
|
||||||
|
|
|
@ -1677,12 +1677,25 @@ static Scheme_Object *do_namespace_attach_module(const char *who, int argc, Sche
|
||||||
name);
|
name);
|
||||||
else {
|
else {
|
||||||
/* instantiate for-label: */
|
/* instantiate for-label: */
|
||||||
|
Scheme_Cont_Frame_Data cframe;
|
||||||
|
Scheme_Config *config;
|
||||||
|
|
||||||
|
/* make sure `from_env' is the current namespace, because
|
||||||
|
start_module() may need to resolve module paths: */
|
||||||
|
config = scheme_extend_config(scheme_current_config(),
|
||||||
|
MZCONFIG_ENV,
|
||||||
|
(Scheme_Object *)from_env);
|
||||||
|
scheme_push_continuation_frame(&cframe);
|
||||||
|
scheme_set_cont_mark(scheme_parameterization_key, (Scheme_Object *)config);
|
||||||
|
|
||||||
start_module(m2,
|
start_module(m2,
|
||||||
from_env->label_env, 0,
|
from_env->label_env, 0,
|
||||||
main_modidx,
|
main_modidx,
|
||||||
0, 0, from_env->phase,
|
0, 0, from_env->phase,
|
||||||
scheme_null);
|
scheme_null);
|
||||||
|
|
||||||
|
scheme_pop_continuation_frame(&cframe);
|
||||||
|
|
||||||
/* try again: */
|
/* try again: */
|
||||||
menv = (Scheme_Env *)scheme_hash_get(MODCHAIN_TABLE(from_env->label_env->modchain), name);
|
menv = (Scheme_Env *)scheme_hash_get(MODCHAIN_TABLE(from_env->label_env->modchain), name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user