make `namespace->module' fail on kernel modules for the right reason
This commit is contained in:
parent
67272f114b
commit
c4b820e5c5
|
@ -314,6 +314,7 @@ static void init_unsafe(Scheme_Env *env)
|
|||
pt = unsafe_env->module->me->rt;
|
||||
scheme_populate_pt_ht(pt);
|
||||
scheme_protect_primitive_provide(unsafe_env, NULL);
|
||||
unsafe_env->attached = 1;
|
||||
|
||||
#if USE_COMPILED_STARTUP
|
||||
if (builtin_ref_counter != (EXPECTED_PRIM_COUNT + EXPECTED_UNSAFE_COUNT)) {
|
||||
|
@ -339,6 +340,7 @@ static void init_flfxnum(Scheme_Env *env)
|
|||
pt = flfxnum_env->module->me->rt;
|
||||
scheme_populate_pt_ht(pt);
|
||||
scheme_protect_primitive_provide(flfxnum_env, NULL);
|
||||
flfxnum_env->attached = 1;
|
||||
|
||||
#if USE_COMPILED_STARTUP
|
||||
if (builtin_ref_counter != (EXPECTED_PRIM_COUNT + EXPECTED_UNSAFE_COUNT + EXPECTED_FLFXNUM_COUNT)) {
|
||||
|
@ -363,6 +365,7 @@ static void init_futures(Scheme_Env *env)
|
|||
pt = futures_env->module->me->rt;
|
||||
scheme_populate_pt_ht(pt);
|
||||
scheme_protect_primitive_provide(futures_env, NULL);
|
||||
futures_env->attached = 1;
|
||||
|
||||
#if USE_COMPILED_STARTUP
|
||||
if (builtin_ref_counter != (EXPECTED_PRIM_COUNT + EXPECTED_UNSAFE_COUNT + EXPECTED_FLFXNUM_COUNT + EXPECTED_FUTURES_COUNT)) {
|
||||
|
|
|
@ -2628,17 +2628,20 @@ Scheme_Object *scheme_module_to_namespace(Scheme_Object *name, Scheme_Env *env)
|
|||
|
||||
name = scheme_module_resolve(scheme_make_modidx(name, scheme_false, scheme_false), 1);
|
||||
|
||||
modchain = env->modchain;
|
||||
menv = (Scheme_Env *)scheme_hash_get(MODCHAIN_TABLE(modchain), name);
|
||||
menv = get_special_modenv(name);
|
||||
if (!menv) {
|
||||
if (scheme_hash_get(env->module_registry->loaded, name))
|
||||
scheme_arg_mismatch("module->namespace",
|
||||
"module not instantiated in the current namespace: ",
|
||||
name);
|
||||
else
|
||||
scheme_arg_mismatch("module->namespace",
|
||||
"unknown module in the current namespace: ",
|
||||
name);
|
||||
modchain = env->modchain;
|
||||
menv = (Scheme_Env *)scheme_hash_get(MODCHAIN_TABLE(modchain), name);
|
||||
if (!menv) {
|
||||
if (scheme_hash_get(env->module_registry->loaded, name))
|
||||
scheme_arg_mismatch("module->namespace",
|
||||
"module not instantiated in the current namespace: ",
|
||||
name);
|
||||
else
|
||||
scheme_arg_mismatch("module->namespace",
|
||||
"unknown module in the current namespace: ",
|
||||
name);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user