gawk-diffs
[Top][All Lists]
Advanced

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

[SCM] gawk branch, feature/mdim-restart, updated. gawk-4.1.0-4779-gf1623


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/mdim-restart, updated. gawk-4.1.0-4779-gf1623195
Date: Thu, 2 Jun 2022 12:52:43 -0400 (EDT)

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, feature/mdim-restart has been updated
       via  f162319580b6a32dfdc6d40880bf329f281f02c5 (commit)
       via  086487f537084f793b9ed698467ed5ced2bac0c9 (commit)
      from  9e3bdae69574f3339dc327ba735a6e7209e67bc3 (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=f162319580b6a32dfdc6d40880bf329f281f02c5

commit f162319580b6a32dfdc6d40880bf329f281f02c5
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Jun 2 19:52:31 2022 +0300

    Add a new test.

diff --git a/pc/ChangeLog b/pc/ChangeLog
index 38a36607..15287b22 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-06-02         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.tst: Regenerated.
+
 2022-05-24         Adam Van Scyoc        <avanscy@g.clemson.edu>
 
        * Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index bd758c15..54d86dca 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -202,7 +202,7 @@ GAWK_EXT_TESTS = \
        indirectcall3 indirectbuiltin2 \
        inf-nan-torture intarray iolint isarrayunset lint lintexp \
        lintindex lintint lintlength lintold lintplus lintset lintwarn \
-       mdim1 mdim2 \
+       mdim1 mdim2 mdim3 \
        manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \
        modifiers muldimposix nastyparm negtime next nondec nondec2 \
        nonfatal1 nonfatal2 nonfatal3 nsawk1a nsawk1b nsawk1c nsawk2a \
@@ -3018,6 +3018,11 @@ mdim2:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+mdim3:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 match1:
        @echo $@
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index ef81faf1..7bd6b3c8 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2022-06-02         Arnold D. Robbins     <arnold@skeeve.com>
+
+       * Makefile.am (EXTRA_DIST): mdim3: new test.
+       * mdim3.awk, mdim3.ok: New files.
+
 2022-05-24         Adam Van Scyoc        <avanscy@g.clemson.edu>
 
        * Makefile.am (EXTRA_DIST): getlnfa, new test.
diff --git a/test/Makefile.am b/test/Makefile.am
index 4e6782f2..fe4872f9 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -682,6 +682,8 @@ EXTRA_DIST = \
        mdim1.ok \
        mdim2.awk \
        mdim2.ok \
+       mdim3.awk \
+       mdim3.ok \
        modifiers.sh \
        modifiers.ok \
        muldimposix.awk \
@@ -1480,7 +1482,7 @@ GAWK_EXT_TESTS = \
        indirectcall3 indirectbuiltin2 \
        inf-nan-torture intarray iolint isarrayunset lint lintexp \
        lintindex lintint lintlength lintold lintplus lintset lintwarn \
-       mdim1 mdim2 \
+       mdim1 mdim2 mdim3 \
        manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \
        modifiers muldimposix nastyparm negtime next nondec nondec2 \
        nonfatal1 nonfatal2 nonfatal3 nsawk1a nsawk1b nsawk1c nsawk2a \
diff --git a/test/Makefile.in b/test/Makefile.in
index 6c8ec4d9..55abe14b 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -948,6 +948,8 @@ EXTRA_DIST = \
        mdim1.ok \
        mdim2.awk \
        mdim2.ok \
+       mdim3.awk \
+       mdim3.ok \
        modifiers.sh \
        modifiers.ok \
        muldimposix.awk \
@@ -1746,7 +1748,7 @@ GAWK_EXT_TESTS = \
        indirectcall3 indirectbuiltin2 \
        inf-nan-torture intarray iolint isarrayunset lint lintexp \
        lintindex lintint lintlength lintold lintplus lintset lintwarn \
-       mdim1 mdim2 \
+       mdim1 mdim2 mdim3 \
        manyfiles match1 match2 match3 mbstr1 mbstr2 mixed1 mktime \
        modifiers muldimposix nastyparm negtime next nondec nondec2 \
        nonfatal1 nonfatal2 nonfatal3 nsawk1a nsawk1b nsawk1c nsawk2a \
@@ -4725,6 +4727,11 @@ mdim2:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+mdim3:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 match1:
        @echo $@
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index ec210863..3015eb34 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1738,6 +1738,11 @@ mdim2:
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
        @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
 
+mdim3:
+       @echo $@
+       @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@
+       @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
 match1:
        @echo $@
        @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk  >_$@ 2>&1 || echo EXIT CODE: 
$$? >>_$@

http://git.sv.gnu.org/cgit/gawk.git/commit/?id=086487f537084f793b9ed698467ed5ced2bac0c9

commit 086487f537084f793b9ed698467ed5ced2bac0c9
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Thu Jun 2 19:48:12 2022 +0300

    Fix memory corruption problem.

diff --git a/ChangeLog b/ChangeLog
index fddb7714..11dcf692 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2022-06-02         Arnold D. Robbins     <arnold@skeeve.com>
+
+       Fix a nasty memory corruption problem. Thanks to
+       Andrew Schorr for the report.
+
+       * eval.c (r_get_lhs): Handle Node_elem_new separately
+       to free the string value. This was not the problem.
+       * interpret.h (r_interpret): For Op_assign, when turning
+       Node_elem_new into the null string, DEREF the old value
+       and dupnode the new one. THIS was the problem.
+
 2022-05-24         Adam Van Scyoc        <avanscy@g.clemson.edu>
 
        * awkgram.y (make_assignable): Handle Op_field_assign.
diff --git a/eval.c b/eval.c
index e54e925f..528a097e 100644
--- a/eval.c
+++ b/eval.c
@@ -1164,7 +1164,14 @@ r_get_lhs(NODE *n, bool reference)
                }
                /* fall through */
        case Node_var_new:
+               n->type = Node_var;
+               n->var_value = dupnode(Nnull_string);
+               break;
+
        case Node_elem_new:
+               free(n->stptr);
+               n->stptr = NULL;
+               n->stlen = 0;
                n->type = Node_var;
                n->var_value = dupnode(Nnull_string);
                break;
diff --git a/interpret.h b/interpret.h
index 7d0952e6..e4cbd1f3 100644
--- a/interpret.h
+++ b/interpret.h
@@ -851,7 +851,8 @@ mod:
                        r = TOP_SCALAR();
                        unref(*lhs);
                        if (r->type == Node_elem_new) {
-                               r = Nnull_string;
+                               DEREF(r);
+                               r = dupnode(Nnull_string);
                        }
                        UPREF(r);
                        UNFIELD(*lhs, r);

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

Summary of changes:
 ChangeLog        | 11 +++++++++++
 eval.c           |  7 +++++++
 interpret.h      |  3 ++-
 pc/ChangeLog     |  4 ++++
 pc/Makefile.tst  |  7 ++++++-
 test/ChangeLog   |  5 +++++
 test/Makefile.am |  4 +++-
 test/Makefile.in |  9 ++++++++-
 test/Maketests   |  5 +++++
 9 files changed, 51 insertions(+), 4 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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