From 310b3d130c19ae862da352e4e2f29ecb21235846 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 9 Apr 2023 01:57:17 -0700 Subject: autoload: temporarily disable backward compat. The purpose of this change is to help with the situation when an uncompiled stdlib is being used (.tl files, no .tlo) and txr is invoked with -C to select compatibility mode with an old version. The problem with compatibility is that it potentially breaks the library due to the different behavior of some macros like caseql. Some test cases in the test suite use backwards compatibility, and sometimes it is necessary to run with the uncompiled test suite when debugging compiler work: situations when the compiler is too broken to build the library. * autoload.c (autoload_try): Temporarly set the opt_compat option to 0 (disabled) around autoload processing. Thus the loading of library code in source code form will not be adversely affected by any syntax or macro level backward compatibility hacks. --- autoload.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'autoload.c') diff --git a/autoload.c b/autoload.c index bb293022..002ddee4 100644 --- a/autoload.c +++ b/autoload.c @@ -999,11 +999,14 @@ static val autoload_try(al_ns_t ns, val sym) if (check) { unsigned ds = debug_clear(opt_dbg_autoload ? 0 : DBG_ENABLE); val saved_dyn_env = dyn_env; + int saved_compat = opt_compat; remhash(autoload_reg_hash, fun); dyn_env = make_env(nil, nil, dyn_env); env_vbind(dyn_env, package_s, system_package); env_vbind(dyn_env, package_alist_s, packages); + opt_compat = 0; funcall(fun); + opt_compat = saved_compat; dyn_env = saved_dyn_env; debug_restore(ds); return t; -- cgit v1.2.3