From 42686f480eda0ddbae7d0b0ded84b6aabde1eb13 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 3 Jun 2023 23:08:11 -0700 Subject: 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. --- autoload.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'autoload.c') 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; -- cgit v1.2.3