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
commit42686f480eda0ddbae7d0b0ded84b6aabde1eb13 (patch)
treee4833521ea814451e03fa11f767d81810ec47be9
parentc3d5c6ae8f29f8a6452ae500fe037fa9aeea0763 (diff)
downloadtxr-42686f480eda0ddbae7d0b0ded84b6aabde1eb13.tar.gz
txr-42686f480eda0ddbae7d0b0ded84b6aabde1eb13.tar.bz2
txr-42686f480eda0ddbae7d0b0ded84b6aabde1eb13.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;