diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2023-05-15 06:26:55 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2023-05-15 06:26:55 -0700 |
commit | 35c8f215451961d7551187261cdf6cbf2c6ee7d3 (patch) | |
tree | 8db0ae888ba577eaa4eb9eeb38e837de1e39e8d5 /stdlib/compiler.tl | |
parent | 843300f468d8950ebffdfa19a91353c640105080 (diff) | |
download | txr-35c8f215451961d7551187261cdf6cbf2c6ee7d3.tar.gz txr-35c8f215451961d7551187261cdf6cbf2c6ee7d3.tar.bz2 txr-35c8f215451961d7551187261cdf6cbf2c6ee7d3.zip |
vm: bugfix: global lexicals looked up dynamically.
The getlx and setlx VM instructions are using dynamic lookup
for uncached bindings, due to using the same lookup_fun
search function. They should use lookup_global_fun.
That doesn't have an environment parameter though, so the
type is not right. However, the VM never uses the environment
parameter; it's always passing nil. We will get rid of the
environment parameter in the lookup_fn callback and introduce
a few wrappers.
* eval.c, eval.h (lookup_global_fun, lookup_dynamic_var,
lookup_dynamic_sym_lisp1): New functions.
* vm.c (vm_stab_slowpath, vm_get_binding): lookup_fn argument
loses environment parameter, and so we don't have to pass nil.
(vm_gcall, vm_gapply): Use pass lookup_global_fun to
to vm_stab.
(vm_getsym, vm_getbind, vm_setsym, vm_gettab, vm_settab):
lookup_fn argument loses environment parameter.
(vm_execute): lookup functions replaced with the appropriate
one-argument ones. GETLX and SETLX see a behavior change,
due to using lookup_global_var which doesn't search the
dynamic environment.
Diffstat (limited to 'stdlib/compiler.tl')
0 files changed, 0 insertions, 0 deletions