summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2023-06-03 23:08:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2023-06-03 23:08:11 -0700
commit624b9872a222a73273d47ec6215e4d30aeb98dcd (patch)
treee4833521ea814451e03fa11f767d81810ec47be9
parent88e58ad49c49e6641276fb5d8e40685c7f06b1ea (diff)
downloadtxr-624b9872a222a73273d47ec6215e4d30aeb98dcd.tar.gz
txr-624b9872a222a73273d47ec6215e4d30aeb98dcd.tar.bz2
txr-624b9872a222a73273d47ec6215e4d30aeb98dcd.zip
bug: autoload issue affecting with-compilation-unit
When a (with-compilation-unit ...) form is compiled, it references the value of a certain special variable that is private to the compiler. This reference is correct, but the variable's symbol is not hooked up to trigger autoload. If the compiler module has not yet been loaded, and the compiled version of a with-compilation-unit form is evaluated, it will fail due to an unbound variable error. * autoload.c (compiler_set_entries): Add the sys:*in-compilation-unit* variable name to the autoload triggers for the compiler module.
-rw-r--r--autoload.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/autoload.c b/autoload.c
index 040b04f4..2784dd4c 100644
--- a/autoload.c
+++ b/autoload.c
@@ -663,6 +663,10 @@ static val compiler_set_entries(val fun)
lit("with-compile-opts"), lit("compiler-let"),
nil
};
+ val sys_vname[] = {
+ lit("*in-compilation-unit*"),
+ nil
+ };
val vname[] = {
lit("*opt-level*"), lit("*compile-opts*"),
nil
@@ -674,6 +678,7 @@ static val compiler_set_entries(val fun)
autoload_sys_set(al_struct, sys_name, fun);
autoload_set(al_struct, sname, fun);
autoload_set(al_fun, name, fun);
+ autoload_sys_set(al_var, sys_vname, fun);
autoload_set(al_var, vname, fun);
autoload_set(al_slot, slname, fun);
return nil;