diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2021-06-29 07:55:08 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2021-06-29 07:55:08 -0700 |
commit | 05500916c74317905fb6f75088f50606a9b562af (patch) | |
tree | c881cf1109afb6880daadf8428d5d8dae835c7d3 /genprotsym.txr | |
parent | d5d2a4c79c2e6203798cf985df5f23964a04817f (diff) | |
download | txr-05500916c74317905fb6f75088f50606a9b562af.tar.gz txr-05500916c74317905fb6f75088f50606a9b562af.tar.bz2 txr-05500916c74317905fb6f75088f50606a9b562af.zip |
compiler: bug: diagnose excess args from apply list.
When we compile an immediately applied lambda like
(apply (lambda (a b c) ...) list), we are not emitting code to
handle the run-time situation when there are too many elements
in the list. This shows up in exception handling, for
instance; the compiled version of this executes silently and
returns 42:
(catch (throw 'foo 5) (foo () 42)))
foo is must have a parameter to capture the 5; interpreted
code enforces this.
* stdlib/compiler.tl (lambda-apply-transform): In the
apply-list case, at the end of binding all the optional
arguments, if the parameter list doesn't have a rest
parameter to take any remaining items, we emit code to check
that there aren't any; that everything has been popped out of
the apply list, leaving it nil. If not, we call the
run-time support function lambda-excess-apply-list.
* stdlib/error.tl (lambda-excess-apply-list): New function.
Diffstat (limited to 'genprotsym.txr')
0 files changed, 0 insertions, 0 deletions