diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | eval.c | 7 | ||||
-rw-r--r-- | pc/Makefile.tst | 7 | ||||
-rw-r--r-- | test/ChangeLog | 6 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/functab5.awk | 12 | ||||
-rw-r--r-- | test/functab5.ok | 46 |
9 files changed, 98 insertions, 3 deletions
@@ -1,3 +1,8 @@ +2020-10-29 Arnold D. Robbins <arnold@skeeve.com> + + * eval.c (setup_frame): Handle the case of values from FUNCTAB. + Thanks to Denis Shirokov <cosmogen@gmail.com> for the report. + 2020-10-12 Arnold D. Robbins <arnold@skeeve.com> * gawkapi.c (api_lintwarn): Fix comparison, should be to check @@ -1337,6 +1337,13 @@ setup_frame(INSTRUCTION *pc) r->var_value = m; break; + case Node_func: + case Node_builtin_func: + case Node_ext_func: + r->type = Node_var; + r->var_value = make_string(m->vname, strlen(m->vname)); + break; + default: cant_happen(); } diff --git a/pc/Makefile.tst b/pc/Makefile.tst index 7735fd1d..25766393 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -237,7 +237,7 @@ LOCALE_CHARSET_TESTS = \ SHLIB_TESTS = \ apiterm \ - filefuncs fnmatch fork fork2 fts functab4 \ + filefuncs fnmatch fork fork2 fts functab4 functab5 \ getfile \ inplace1 inplace2 inplace2bcomp inplace3 inplace3bcomp \ ordchr ordchr2 \ @@ -3488,6 +3488,11 @@ functab4: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +functab5: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ordchr: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/ChangeLog b/test/ChangeLog index 6bd4dd13..3817087e 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,9 @@ +2020-10-29 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (EXTRA_DIST): functab5, new test. + (SHLIB_TESTS): Ditto. + * functab5.awk, functab5.ok: New files. + 2020-10-09 Arnold D. Robbins <arnold@skeeve.com> * xref.awk: Bug fix: Identifiers can have underscore in the middle. diff --git a/test/Makefile.am b/test/Makefile.am index 3880c5b1..d6bf7c20 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -407,6 +407,8 @@ EXTRA_DIST = \ functab3.ok \ functab4.awk \ functab4.ok \ + functab5.awk \ + functab5.ok \ funlen.awk \ funlen.in \ funlen.ok \ @@ -1461,7 +1463,7 @@ LOCALE_CHARSET_TESTS = \ SHLIB_TESTS = \ apiterm \ - filefuncs fnmatch fork fork2 fts functab4 \ + filefuncs fnmatch fork fork2 fts functab4 functab5 \ getfile \ inplace1 inplace2 inplace2bcomp inplace3 inplace3bcomp \ ordchr ordchr2 \ diff --git a/test/Makefile.in b/test/Makefile.in index 28566ae8..884d353d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -670,6 +670,8 @@ EXTRA_DIST = \ functab3.ok \ functab4.awk \ functab4.ok \ + functab5.awk \ + functab5.ok \ funlen.awk \ funlen.in \ funlen.ok \ @@ -1720,7 +1722,7 @@ LOCALE_CHARSET_TESTS = \ SHLIB_TESTS = \ apiterm \ - filefuncs fnmatch fork fork2 fts functab4 \ + filefuncs fnmatch fork fork2 fts functab4 functab5 \ getfile \ inplace1 inplace2 inplace2bcomp inplace3 inplace3bcomp \ ordchr ordchr2 \ @@ -5123,6 +5125,11 @@ functab4: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +functab5: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ordchr: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index b01e0c54..2cf71332 100644 --- a/test/Maketests +++ b/test/Maketests @@ -2217,6 +2217,11 @@ functab4: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +functab5: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + ordchr: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/functab5.awk b/test/functab5.awk new file mode 100644 index 00000000..7d6da1f1 --- /dev/null +++ b/test/functab5.awk @@ -0,0 +1,12 @@ +@load "filefuncs" + +BEGIN { + PROCINFO["sorted_in"] = "sort" + for (i in FUNCTAB) + print i "'" +} + +function sort(i1, v1, i2, v2) +{ + return i1 == i2 ? 0 : i1 < i2 ? -1 : +1 +} diff --git a/test/functab5.ok b/test/functab5.ok new file mode 100644 index 00000000..9ac4295d --- /dev/null +++ b/test/functab5.ok @@ -0,0 +1,46 @@ +and' +asort' +asorti' +atan2' +bindtextdomain' +chdir' +close' +compl' +cos' +dcgettext' +dcngettext' +exp' +fflush' +fts' +gensub' +gsub' +index' +int' +isarray' +length' +log' +lshift' +match' +mktime' +or' +patsplit' +rand' +rshift' +sin' +sort' +split' +sprintf' +sqrt' +srand' +stat' +statvfs' +strftime' +strtonum' +sub' +substr' +system' +systime' +tolower' +toupper' +typeof' +xor' |