diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2019-09-26 06:50:00 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2019-09-26 06:50:00 -0700 |
commit | bdf889cb57c44254ea0f2d3b7a06aac3b77b5edb (patch) | |
tree | 648061499ae52fec7f5ee63db449bc487f8e56be /lib.c | |
parent | 3d894ee5b065483f749eb7d174daf0d242c54404 (diff) | |
download | txr-bdf889cb57c44254ea0f2d3b7a06aac3b77b5edb.tar.gz txr-bdf889cb57c44254ea0f2d3b7a06aac3b77b5edb.tar.bz2 txr-bdf889cb57c44254ea0f2d3b7a06aac3b77b5edb.zip |
func-get-name: fix bogus return for nil argument.
* eval.c (func_get_name): when func_get_name has a nil
function argument and nil env, it falls back on method_name,
which naively searches its space and finds some static slots
with a nil value which is then returned as a method name.
Let's put in a type check that the argument must be a
function. Also, let's drop the recursion in the nested
environment search and switch to iteration, so we don't do
these wasteful sanity checks on multiple re-entries of the
function.
Diffstat (limited to 'lib.c')
0 files changed, 0 insertions, 0 deletions