diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | builtin.c | 4 | ||||
-rw-r--r-- | pc/ChangeLog | 4 | ||||
-rw-r--r-- | pc/Makefile.tst | 7 | ||||
-rw-r--r-- | test/ChangeLog | 2 | ||||
-rw-r--r-- | test/Makefile.am | 4 | ||||
-rw-r--r-- | test/Makefile.in | 9 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/isarrayunset.awk | 1 | ||||
-rw-r--r-- | test/isarrayunset.ok | 1 |
10 files changed, 39 insertions, 4 deletions
@@ -1,3 +1,9 @@ +2018-01-17 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (do_isarray): Check that tmp is Node_var + before calling DEREF. Thanks to Denis Shirokov + <cosmogen@gmail.com> for the report. + 2018-01-15 Arnold D. Robbins <arnold@skeeve.com> * NEWS: Small typo fix. @@ -507,7 +507,9 @@ do_isarray(int nargs) tmp = POP(); if (tmp->type != Node_var_array) { ret = 0; - DEREF(tmp); + // could be Node_var_new + if (tmp->type == Node_val) + DEREF(tmp); } return make_number((AWKNUM) ret); } diff --git a/pc/ChangeLog b/pc/ChangeLog index 15a3e382..a007290e 100644 --- a/pc/ChangeLog +++ b/pc/ChangeLog @@ -1,3 +1,7 @@ +2018-01-17 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.tst: Sync against test/Makefile.in. + 2018-01-10 Arnold D. Robbins <arnold@skeeve.com> * Makefile.tst: Initial sync against test/Makefile.in. diff --git a/pc/Makefile.tst b/pc/Makefile.tst index b7622df8..982d1ce0 100644 --- a/pc/Makefile.tst +++ b/pc/Makefile.tst @@ -202,7 +202,7 @@ GAWK_EXT_TESTS = \ genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \ icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase incdupe \ incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 include include2 \ - indirectbuiltin indirectcall indirectcall2 intarray \ + indirectbuiltin indirectcall indirectcall2 intarray isarrayunset \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ mixed1 mktime manyfiles match1 match2 match3 mbstr1 mbstr2 muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ @@ -2755,6 +2755,11 @@ indirectcall2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +isarrayunset: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + lint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/ChangeLog b/test/ChangeLog index b20fff47..abff2dd7 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -3,6 +3,8 @@ * Makefile.am (charset-tests-all): Add punctuation in the message. (charset-msg-start): Add fr_FR.UTF-8 to list of desired locales, reformat the message. + (isarrayunset): New test. + * isarrayunset.awk, isarrayunset.ok: New files. 2018-01-15 Arnold D. Robbins <arnold@skeeve.com> diff --git a/test/Makefile.am b/test/Makefile.am index 26996ad0..34d90782 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -557,6 +557,8 @@ EXTRA_DIST = \ intprec.ok \ iobug1.awk \ iobug1.ok \ + isarrayunset.awk \ + isarrayunset.ok \ jarebug.awk \ jarebug.in \ jarebug.ok \ @@ -1271,7 +1273,7 @@ GAWK_EXT_TESTS = \ genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \ icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase incdupe \ incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 include include2 \ - indirectbuiltin indirectcall indirectcall2 intarray \ + indirectbuiltin indirectcall indirectcall2 intarray isarrayunset \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ mixed1 mktime manyfiles match1 match2 match3 mbstr1 mbstr2 muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ diff --git a/test/Makefile.in b/test/Makefile.in index e3e98da0..f8b6e05d 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -815,6 +815,8 @@ EXTRA_DIST = \ intprec.ok \ iobug1.awk \ iobug1.ok \ + isarrayunset.awk \ + isarrayunset.ok \ jarebug.awk \ jarebug.in \ jarebug.ok \ @@ -1528,7 +1530,7 @@ GAWK_EXT_TESTS = \ genpot gensub gensub2 gensub3 getlndir gnuops2 gnuops3 gnureops gsubind \ icasefs icasers id igncdym igncfs ignrcas2 ignrcas4 ignrcase incdupe \ incdupe2 incdupe3 incdupe4 incdupe5 incdupe6 incdupe7 include include2 \ - indirectbuiltin indirectcall indirectcall2 intarray \ + indirectbuiltin indirectcall indirectcall2 intarray isarrayunset \ lint lintexp lintindex lintint lintlength lintold lintset lintwarn \ mixed1 mktime manyfiles match1 match2 match3 mbstr1 mbstr2 muldimposix \ nastyparm negtime next nondec nondec2 nonfatal1 nonfatal2 nonfatal3 \ @@ -4232,6 +4234,11 @@ indirectcall2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +isarrayunset: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + lint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index 6a685101..314aaaec 100644 --- a/test/Maketests +++ b/test/Maketests @@ -1327,6 +1327,11 @@ indirectcall2: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +isarrayunset: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + lint: @echo $@ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ diff --git a/test/isarrayunset.awk b/test/isarrayunset.awk new file mode 100644 index 00000000..8b54cdca --- /dev/null +++ b/test/isarrayunset.awk @@ -0,0 +1 @@ +BEGIN { print isarray(a) } diff --git a/test/isarrayunset.ok b/test/isarrayunset.ok new file mode 100644 index 00000000..573541ac --- /dev/null +++ b/test/isarrayunset.ok @@ -0,0 +1 @@ +0 |