diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-09-01 22:43:37 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-09-01 22:43:37 +0300 |
commit | 2783f2c7d4e52fa7accfba7b847c416d8c71cd0f (patch) | |
tree | 7ddf714b73d1f420afb5c2a318e6debd1843f7d7 | |
parent | bfc794de222760871c6c6de6bb923a0bf57ee166 (diff) | |
download | egawk-2783f2c7d4e52fa7accfba7b847c416d8c71cd0f.tar.gz egawk-2783f2c7d4e52fa7accfba7b847c416d8c71cd0f.tar.bz2 egawk-2783f2c7d4e52fa7accfba7b847c416d8c71cd0f.zip |
Bug fix in handling indirect function calls.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | interpret.h | 6 |
2 files changed, 11 insertions, 1 deletions
@@ -4,6 +4,12 @@ result is passed to length() with --lint. Based on discussions in comp.lang.awk. + Unrelated: + + * interpret.h (r_interpret): For indirect function call, separate + error message if lookup returned NULL. Otherwise got a core dump. + Thanks to "Kenny McKormack" for the report in comp.lang.awk. + 2014-08-27 Arnold D. Robbins <arnold@skeeve.com> * configure.ac: Add test for strcasecmp. diff --git a/interpret.h b/interpret.h index c26a9d46..be017355 100644 --- a/interpret.h +++ b/interpret.h @@ -1038,7 +1038,11 @@ match_re: f = lookup(t1->stptr); } - if (f == NULL || f->type != Node_func) { + if (f == NULL) { + /* FIXME: See if function is a built-in and try to call it */ + fatal(_("`%s' is not a user-defined function, so it cannot be called indirectly"), + t1->stptr); + } else if(f->type != Node_func) { if (f->type == Node_ext_func || f->type == Node_old_ext_func) fatal(_("cannot (yet) call extension functions indirectly")); else |