diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-03-19 22:07:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-03-19 22:07:34 -0700 |
commit | 50b3b8a020217910041ece4f380cc97ed6845ae9 (patch) | |
tree | 2ecd4cb89328822ff1997ff82aff15be0fc72e33 /ftw.c | |
parent | f0b797d9b99951d9b08bd0c0bddff283401703ec (diff) | |
download | txr-50b3b8a020217910041ece4f380cc97ed6845ae9.tar.gz txr-50b3b8a020217910041ece4f380cc97ed6845ae9.tar.bz2 txr-50b3b8a020217910041ece4f380cc97ed6845ae9.zip |
vm: support deferred resolution of ftab bindings.
This allows a virtual machine's funvec to refer to functions
that are not yet defined. We resolve all the ones that are
defined when the virtual machine description is constructed.
The others are resolved at vm execution time when accessed.
* vm.c (vm_make_desc): When filling ftab with resolved
function bindings, check that lookup_fun has returned nil; in
that case, initialize the binding location to zero,
instead of blowing up calling cdr_l(nil).
(vm_ftab): New static function. Implements the null check
and late resolution.
(vm_gcall, vm_gapply): Acces ftab through vm_ftab instead
of open-coded expression.
Diffstat (limited to 'ftw.c')
0 files changed, 0 insertions, 0 deletions