gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[SCM] gawk branch, gawk-5.3-stable, updated. gawk-4.1.0-5441-g4217d4bd


From: Arnold Robbins
Subject: [SCM] gawk branch, gawk-5.3-stable, updated. gawk-4.1.0-5441-g4217d4bd
Date: Sun, 24 Dec 2023 10:41:34 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-5.3-stable has been updated
       via  4217d4bd8600d49335d8a1d2922d5a1ee1921d7c (commit)
      from  8083ca907e3c427ae514a6b4ca91c7459d69ffdb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=4217d4bd8600d49335d8a1d2922d5a1ee1921d7c

commit 4217d4bd8600d49335d8a1d2922d5a1ee1921d7c
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Sun Dec 24 17:41:07 2023 +0200

    Fix core dump on debugger watchpoints.

diff --git a/ChangeLog b/ChangeLog
index 9e83d05d..ab3e2fb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,16 @@
 2023-12-24         Arnold D. Robbins     <arnold@skeeve.com>
 
-       * debug.c pr (print_array): Use the subscript as the
+       * debug.c (print_array): Use the subscript as the
        subarray name instead of the `vname' field. This field
        is not there for arrays created with NUMINT subscripts.
        Thanks again to Hermann Peifer for the report.
 
+       Unrelated:
+
+       * debug.c (find_subscript): Fail early on Node_var_new
+       and Node_elem_new.  Thanks yet again to Hermann Peifer
+       for the report.
+
 2023-12-21         Arnold D. Robbins     <arnold@skeeve.com>
 
        Fix multidimensional array printing in the debugger, again.
diff --git a/debug.c b/debug.c
index aee27b40..fc53d4e9 100644
--- a/debug.c
+++ b/debug.c
@@ -1682,6 +1682,10 @@ find_subscript(struct list_item *item, NODE **ptr)
        NODE *sub, *r;
        int i = 0, count = item->num_subs;
 
+       // without this check, in_array() will SEGV...
+       if (symbol->type == Node_var_new || symbol->type == Node_elem_new)
+               return -1;
+
        r = *ptr = NULL;
        for (i = 0; i < count; i++) {
                sub = item->subs[i];
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 4245f4f2..daf3c56d 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -222,7 +222,7 @@ GAWK_EXT_TESTS = \
        symtab11 symtab12 timeout typedregex1 typedregex2 typedregex3 \
        typedregex4 typedregex5 typedregex6 typeof1 typeof2 typeof3 \
        typeof4 typeof5 typeof6 unicode1 watchpoint1 \
-       re_test typeof7 typeof8 dbugarray1 dbugarray2 dbugarray3
+       re_test typeof7 typeof8 dbugarray1 dbugarray2 dbugarray3 dbugarray4
 
 ARRAYDEBUG_TESTS = arrdbg
 EXTRA_TESTS = inftest regtest ignrcas3 
@@ -244,7 +244,7 @@ SHLIB_TESTS = \
 
 # List of the tests which should be run with --debug option:
 NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4 \
-            dbugarray1 dbugarray2 dbugarray3
+            dbugarray1 dbugarray2 dbugarray3 dbugarray4
 
 
 # List of the tests which should be run with --lint option:
@@ -3665,6 +3665,11 @@ dbugarray3:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+dbugarray4:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 double1:
        @echo $@ $(ZOS_FAIL)
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index fd9a9e87..b955dcd0 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,7 +1,8 @@
 2023-12-24         Arnold D. Robbins     <arnold@skeeve.com>
 
-       * Makefile.am (EXTRA_DIST): New test: dbugarray3.
-       * dbugarray3.awk, dbugarray3.in, dbugarray3.ok: New files.
+       * Makefile.am (EXTRA_DIST): New tests: dbugarray3, dbugarray4.
+       * dbugarray3.awk, dbugarray3.in, dbugarray3.ok,
+       dbugarray4.awk, dbugarray4.in, dbugarray4.ok: New files.
 
 2023-12-21         Arnold D. Robbins     <arnold@skeeve.com>
 
diff --git a/test/Makefile.am b/test/Makefile.am
index eccd1e0c..a876b3ab 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -253,6 +253,9 @@ EXTRA_DIST = \
        dbugarray3.awk \
        dbugarray3.in \
        dbugarray3.ok \
+       dbugarray4.awk \
+       dbugarray4.in \
+       dbugarray4.ok \
        dbugeval.in \
        dbugeval.ok \
        dbugeval2.awk \
@@ -1583,7 +1586,7 @@ GAWK_EXT_TESTS = \
        symtab11 symtab12 timeout typedregex1 typedregex2 typedregex3 \
        typedregex4 typedregex5 typedregex6 typeof1 typeof2 typeof3 \
        typeof4 typeof5 typeof6 unicode1 watchpoint1 \
-       re_test typeof7 typeof8 dbugarray1 dbugarray2 dbugarray3
+       re_test typeof7 typeof8 dbugarray1 dbugarray2 dbugarray3 dbugarray4
 
 ARRAYDEBUG_TESTS = arrdbg
 
@@ -1608,7 +1611,7 @@ SHLIB_TESTS = \
 
 # List of the tests which should be run with --debug option:
 NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4 \
-            dbugarray1 dbugarray2 dbugarray3
+            dbugarray1 dbugarray2 dbugarray3 dbugarray4
 
 # List of the tests which should be run with --lint option:
 NEED_LINT = \
diff --git a/test/Makefile.in b/test/Makefile.in
index 6315701a..1ef143fe 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -517,6 +517,9 @@ EXTRA_DIST = \
        dbugarray3.awk \
        dbugarray3.in \
        dbugarray3.ok \
+       dbugarray4.awk \
+       dbugarray4.in \
+       dbugarray4.ok \
        dbugeval.in \
        dbugeval.ok \
        dbugeval2.awk \
@@ -1847,7 +1850,7 @@ GAWK_EXT_TESTS = \
        symtab11 symtab12 timeout typedregex1 typedregex2 typedregex3 \
        typedregex4 typedregex5 typedregex6 typeof1 typeof2 typeof3 \
        typeof4 typeof5 typeof6 unicode1 watchpoint1 \
-       re_test typeof7 typeof8 dbugarray1 dbugarray2 dbugarray3
+       re_test typeof7 typeof8 dbugarray1 dbugarray2 dbugarray3 dbugarray4
 
 ARRAYDEBUG_TESTS = arrdbg
 EXTRA_TESTS = inftest regtest ignrcas3 
@@ -1869,7 +1872,7 @@ SHLIB_TESTS = \
 
 # List of the tests which should be run with --debug option:
 NEED_DEBUG = dbugtypedre1 dbugtypedre2 dbugeval2 dbugeval3 dbugeval4 \
-            dbugarray1 dbugarray2 dbugarray3
+            dbugarray1 dbugarray2 dbugarray3 dbugarray4
 
 
 # List of the tests which should be run with --lint option:
@@ -5467,6 +5470,11 @@ dbugarray3:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+dbugarray4:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 double1:
        @echo $@ $(ZOS_FAIL)
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 98f6849e..bac220f1 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2344,6 +2344,11 @@ dbugarray3:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+dbugarray4:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  --debug < "$(srcdir)"/$@.in 
>_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 double1:
        @echo $@ $(ZOS_FAIL)
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
diff --git a/test/dbugarray4.awk b/test/dbugarray4.awk
new file mode 100644
index 00000000..632ecb68
--- /dev/null
+++ b/test/dbugarray4.awk
@@ -0,0 +1,4 @@
+BEGIN {
+       a[1][1] = 1
+       a[1][2] = 2
+}
diff --git a/test/dbugarray4.in b/test/dbugarray4.in
new file mode 100644
index 00000000..8e854970
--- /dev/null
+++ b/test/dbugarray4.in
@@ -0,0 +1,7 @@
+r
+watch a[1]
+r
+cont
+cont
+cont
+q
diff --git a/test/dbugarray4.ok b/test/dbugarray4.ok
new file mode 100644
index 00000000..27217f44
--- /dev/null
+++ b/test/dbugarray4.ok
@@ -0,0 +1,23 @@
+Starting program:
+Program exited normally with exit value: 0
+Watchpoint 1: a["1"]
+error: attempt to use scalar value as array
+Restarting ...
+Starting program:
+Stopping in BEGIN ...
+Watchpoint 1: a["1"]
+  Old value: element not in array
+  New value: array, 0 elements
+main() at `dbugarray4.awk':2
+2              a[1][1] = 1
+Watchpoint 1: a["1"]
+  Old value: array, 0 elements
+  New value: array, 1 elements
+main() at `dbugarray4.awk':2
+2              a[1][1] = 1
+Watchpoint 1: a["1"]
+  Old value: array, 1 elements
+  New value: array, 2 elements
+main() at `dbugarray4.awk':3
+3              a[1][2] = 2
+Program exited normally with exit value: 0

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |  8 +++++++-
 debug.c             |  4 ++++
 pc/Makefile.tst     |  9 +++++++--
 test/ChangeLog      |  5 +++--
 test/Makefile.am    |  7 +++++--
 test/Makefile.in    | 12 ++++++++++--
 test/Maketests      |  5 +++++
 test/dbugarray4.awk |  4 ++++
 test/dbugarray4.in  |  7 +++++++
 test/dbugarray4.ok  | 23 +++++++++++++++++++++++
 10 files changed, 75 insertions(+), 9 deletions(-)
 create mode 100644 test/dbugarray4.awk
 create mode 100644 test/dbugarray4.in
 create mode 100644 test/dbugarray4.ok


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]