diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-03-27 13:28:34 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-03-27 13:28:34 -0700 |
commit | a7880f77c8732c589c410b3294bd09abe6419f1f (patch) | |
tree | bbe6ebb172b58a2a569f86821434c9754e98dc92 /tests/015 | |
parent | f13a86a82c7e526cb02276c361d9844c851740ac (diff) | |
download | txr-a7880f77c8732c589c410b3294bd09abe6419f1f.tar.gz txr-a7880f77c8732c589c410b3294bd09abe6419f1f.tar.bz2 txr-a7880f77c8732c589c410b3294bd09abe6419f1f.zip |
compiler: fix: careless constant folding of call.
* share/txr/stdlib/compiler.tl (compiler comp-apply-call): The
conditions for constant-folding a call expressions are too
weak. The first argument could be a quoted symbol, which is a
constant expression, and so we end up wrongly evaluating
an expression like (call 'print '3) at compile time.
We can constant-fold if the first expression evaluates to a
symbol, which names a constant-foldable function, or else
if it evaluates to something which is not a bindable symbol.
Diffstat (limited to 'tests/015')
0 files changed, 0 insertions, 0 deletions