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-4706-g5ec85


From: Arnold Robbins
Subject: [SCM] gawk branch, feature/mdim-restart, updated. gawk-4.1.0-4706-g5ec85050
Date: Wed, 6 Apr 2022 13:22:51 -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  5ec85050cac30dfb239ba6350b32ff447fe67f11 (commit)
      from  ff3f9433a6ab9d0f4e5ca21e3cf8b7dc69741d39 (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=5ec85050cac30dfb239ba6350b32ff447fe67f11

commit 5ec85050cac30dfb239ba6350b32ff447fe67f11
Author: Arnold D. Robbins <arnold@skeeve.com>
Date:   Wed Apr 6 20:22:36 2022 +0300

    More cleanups.

diff --git a/ChangeLog b/ChangeLog
index 55ad62c4..755f7735 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2022-04-06         Arnold D. Robbins     <arnold@skeeve.com>
+
+       Further cleanups.
+
+       * array.c (new_array_element): Set s->stfmt to STFMT_UNUSED.
+       * awk.h (force_string_fmt): No need to set s->stfmt anymore.
+       * builtin.c (do_typeof): Collapse Node_var_new and Node_elem_new
+       cases.
+       * symbol.c (print_vars): Node_elem_new can't be in a top level
+       variable. Remove check and add a call to cant_happen if some
+       other node type is received.
+       * NEWS: Updated.
+
 2022-04-01         Arnold D. Robbins     <arnold@skeeve.com>
 
        Small fix from the persistent-gawk guys.
diff --git a/NEWS b/NEWS
index 5946cea6..2a57dcc5 100644
--- a/NEWS
+++ b/NEWS
@@ -37,6 +37,9 @@ for saving / restoring all of gawk's variables and arrays.
 Wherever possible, details were replaced with references to the online
 copy of the manual.
 
+9. Some subtle issues with untyped array elements being passed to
+functions have been fixed.
+
 Changes from 5.1.1 to 5.1.2
 ---------------------------
 
diff --git a/array.c b/array.c
index 59948877..aed8fa3e 100644
--- a/array.c
+++ b/array.c
@@ -1445,6 +1445,7 @@ new_array_element(void)
 
        n->stptr = sp;
        n->stlen = 0;
+       n->stfmt = STFMT_UNUSED;
 
        n->flags |= (MALLOC|STRING|STRCUR);
 
diff --git a/awk.h b/awk.h
index cb91cb01..95cc9b67 100644
--- a/awk.h
+++ b/awk.h
@@ -1947,7 +1947,6 @@ force_string_fmt(NODE *s, const char *fmtstr, int fmtidx)
        if (s->type == Node_elem_new) {
                s->type = Node_val;
                s->flags &= ~NUMBER;
-               s->stfmt = STFMT_UNUSED;
 
                return s;
        }
diff --git a/builtin.c b/builtin.c
index 02a172bf..c53a0119 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4340,9 +4340,6 @@ do_typeof(int nargs)
                }
                break;
        case Node_var_new:
-               res = "untyped";
-               deref = false;
-               break;
        case Node_elem_new:
                res = "untyped";
                deref = false;
diff --git a/symbol.c b/symbol.c
index 3488359e..f99057df 100644
--- a/symbol.c
+++ b/symbol.c
@@ -477,10 +477,10 @@ print_vars(NODE **table, int (*print_func)(FILE *, const 
char *, ...), FILE *fp)
                        print_func(fp, "array, %ld elements\n", 
assoc_length(r));
                else if (r->type == Node_var_new)
                        print_func(fp, "untyped variable\n");
-               else if (r->type == Node_elem_new)
-                       print_func(fp, "untyped element\n");
                else if (r->type == Node_var)
                        valinfo(r->var_value, print_func, fp);
+               else
+                       cant_happen("unexpected node type: %s", 
nodetype2str(r->type));
        }
 }
 

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

Summary of changes:
 ChangeLog | 13 +++++++++++++
 NEWS      |  3 +++
 array.c   |  1 +
 awk.h     |  1 -
 builtin.c |  3 ---
 symbol.c  |  4 ++--
 6 files changed, 19 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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