[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4353-g4a7a150
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4353-g4a7a150 |
Date: |
Mon, 22 Nov 2021 14:49:32 -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.1-stable has been updated
via 4a7a1509991bfa9b79816a04fbee3398e3be6841 (commit)
from 5403687cb350d91f81991ad82721648e70651eb9 (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=4a7a1509991bfa9b79816a04fbee3398e3be6841
commit 4a7a1509991bfa9b79816a04fbee3398e3be6841
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Nov 21 20:13:48 2021 +0200
Fix subtle typeof case.
diff --git a/ChangeLog b/ChangeLog
index 26eb7cd..6dd5258 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2021-11-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * builtin.c (do_typeof): Make Node_array_ref handling smarter.
+ See test/stupid5.awk.
+
2021-11-18 Arnold D. Robbins <arnold@skeeve.com>
* gawkapi.c (awk_value_to_node): Fix handling of MPFR values
diff --git a/builtin.c b/builtin.c
index d7ba82c..266bf74 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4186,10 +4186,31 @@ do_typeof(int nargs)
}
break;
case Node_var_new:
- case Node_array_ref:
res = "untyped";
deref = false;
break;
+ case Node_array_ref:
+ /*
+ * function f(x) {
+ * print typeof(x)
+ * y = x
+ * print typeof(x)
+ * }
+ *
+ * BEGIN {
+ * print typeof(x)
+ * f(x)
+ * }
+ */
+ if (arg->orig_array->type == Node_var
+ && (arg->orig_array->var_value == Nnull_string
+ || (arg->orig_array->var_value->flags & NULL_FIELD) !=
0)) {
+ res = "unassigned";
+ } else {
+ res = "untyped";
+ }
+ deref = false;
+ break;
case Node_var:
/*
* Note: this doesn't happen because the function calling code
diff --git a/pc/ChangeLog b/pc/ChangeLog
index e3ffdea..ba9334f 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2021-11-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Regenerated.
+
2021-11-08 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.tst: Regenerated.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index bb70704..97be275 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -210,7 +210,7 @@ GAWK_EXT_TESTS = \
regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 sandbox1 shadow shadowbuiltin sortfor \
sortfor2 sortu sourcesplit split_after_fpat splitarg4 strftfld \
- strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 \
+ strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 stupid5 \
switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 symtab7 \
symtab8 symtab9 symtab10 symtab11 timeout typedregex1 typedregex2 \
typedregex3 typedregex4 typedregex5 typedregex6 typeof1 typeof2 \
@@ -3284,6 +3284,11 @@ stupid4:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid5:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
switch2:
@echo $@
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index 275f487..3f36817 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2021-11-21 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): stupid5, new test.
+ * stupid5.awk, stupid5.ok: New files.
+ * stupid3.ok, stupid4.ok: Updated after code changes.
+
2021-11-18 Arnold D. Robbins <arnold@skeeve.com>
* rwarray.awk: Improve test, add string and numbers.
diff --git a/test/Makefile.am b/test/Makefile.am
index a82c279..b74056e 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1241,6 +1241,8 @@ EXTRA_DIST = \
stupid3.ok \
stupid4.awk \
stupid4.ok \
+ stupid5.awk \
+ stupid5.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -1459,7 +1461,7 @@ GAWK_EXT_TESTS = \
regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 sandbox1 shadow shadowbuiltin sortfor \
sortfor2 sortu sourcesplit split_after_fpat splitarg4 strftfld \
- strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 \
+ strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 stupid5 \
switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 symtab7 \
symtab8 symtab9 symtab10 symtab11 timeout typedregex1 typedregex2 \
typedregex3 typedregex4 typedregex5 typedregex6 typeof1 typeof2 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 1f4e0ed..d56e90d 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1507,6 +1507,8 @@ EXTRA_DIST = \
stupid3.ok \
stupid4.awk \
stupid4.ok \
+ stupid5.awk \
+ stupid5.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -1725,7 +1727,7 @@ GAWK_EXT_TESTS = \
regx8bit reginttrad reint reint2 rsgetline rsglstdin rsstart1 \
rsstart2 rsstart3 rstest6 sandbox1 shadow shadowbuiltin sortfor \
sortfor2 sortu sourcesplit split_after_fpat splitarg4 strftfld \
- strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 \
+ strftime strtonum strtonum1 stupid1 stupid2 stupid3 stupid4 stupid5 \
switch2 symtab1 symtab2 symtab3 symtab4 symtab5 symtab6 symtab7 \
symtab8 symtab9 symtab10 symtab11 timeout typedregex1 typedregex2 \
typedregex3 typedregex4 typedregex5 typedregex6 typeof1 typeof2 \
@@ -4957,6 +4959,11 @@ stupid4:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid5:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
switch2:
@echo $@
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 5133c67..9e00cd5 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2022,6 +2022,11 @@ stupid4:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid5:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
switch2:
@echo $@
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
diff --git a/test/stupid3.ok b/test/stupid3.ok
index 11beb6c..b647c08 100644
--- a/test/stupid3.ok
+++ b/test/stupid3.ok
@@ -1,2 +1,2 @@
TYPEOF: untyped
-TYPEOF: untyped
+TYPEOF: unassigned
diff --git a/test/stupid4.ok b/test/stupid4.ok
index 1271dad..42380a4 100644
--- a/test/stupid4.ok
+++ b/test/stupid4.ok
@@ -1,2 +1,2 @@
untyped
-untyped
+unassigned
diff --git a/test/stupid5.awk b/test/stupid5.awk
new file mode 100644
index 0000000..e4c0187
--- /dev/null
+++ b/test/stupid5.awk
@@ -0,0 +1,9 @@
+BEGIN {
+ print typeof(x)
+ f(x)
+}
+
+function f(x) {
+ y = x
+ print typeof(x)
+}
diff --git a/test/stupid5.ok b/test/stupid5.ok
new file mode 100644
index 0000000..42380a4
--- /dev/null
+++ b/test/stupid5.ok
@@ -0,0 +1,2 @@
+untyped
+unassigned
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 5 +++++
builtin.c | 23 ++++++++++++++++++++++-
pc/ChangeLog | 4 ++++
pc/Makefile.tst | 7 ++++++-
test/ChangeLog | 6 ++++++
test/Makefile.am | 4 +++-
test/Makefile.in | 9 ++++++++-
test/Maketests | 5 +++++
test/stupid3.ok | 2 +-
test/stupid4.ok | 2 +-
test/stupid5.awk | 9 +++++++++
test/stupid5.ok | 2 ++
12 files changed, 72 insertions(+), 6 deletions(-)
create mode 100644 test/stupid5.awk
create mode 100644 test/stupid5.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4353-g4a7a150,
Arnold Robbins <=