summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-10-26 07:25:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-10-26 07:25:51 -0700
commit9733bb6dad3b0c430a82b2592d5519383479cb86 (patch)
treeb894ea6b0a6022e2f5700b1a3e362c721977d9b3 /parser.c
parentc4d91d0128dd998a73d216fe7bb0132c41d901bc (diff)
downloadtxr-9733bb6dad3b0c430a82b2592d5519383479cb86.tar.gz
txr-9733bb6dad3b0c430a82b2592d5519383479cb86.tar.bz2
txr-9733bb6dad3b0c430a82b2592d5519383479cb86.zip
compiler: use symtab caching for global lexicals.
* parser.c (read_file_common): Allow version three object files. * share/txr/stdlib/compiler.tl (compiler comp-var): If a global variable isn't special, then treat it via the getlx instruction. The symbol gets added to the symtab, and referenced by index number. (compiler comp-setq): Similarly, treat a non-special global variable using the setlx instruction. (%tlo-ver%): We bump the major version of .tlo files from 2 to 3, since old txr executables won't recognize these new instructions. However, we are backward compatible; hence read_file_common still allows version 2.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/parser.c b/parser.c
index a6285b75..049da3a7 100644
--- a/parser.c
+++ b/parser.c
@@ -636,7 +636,7 @@ static val read_file_common(val stream, val error_stream, val compiled)
if (compiled && first) {
val major = car(form);
- if (lt(major, one) || gt(major, two))
+ if (lt(major, one) || gt(major, three))
uw_throwf(error_s,
lit("cannot load ~s: version number mismatch"),
stream, nao);