[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, master, updated. gawk-4.1.0-3866-ga2a6e54
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, master, updated. gawk-4.1.0-3866-ga2a6e54 |
Date: |
Wed, 8 Jan 2020 14:05:40 -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, master has been updated
via a2a6e548bc3afcbf4c7401ebdfa8213dbe4e8dea (commit)
via ebe9dd1633c6f5e5d42e922a70f72829c14c193c (commit)
from 660a55b365e4ee22f3f0efe69c887e2fd1f71303 (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=a2a6e548bc3afcbf4c7401ebdfa8213dbe4e8dea
commit a2a6e548bc3afcbf4c7401ebdfa8213dbe4e8dea
Author: Arnold D. Robbins <address@hidden>
Date: Wed Jan 8 21:03:32 2020 +0200
Fix problems passing uninitialized variables to typeof.
diff --git a/ChangeLog b/ChangeLog
index 496c341..0c2d928 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,11 @@
for Node_var_new; variables can exist but have not been assigned
a value.
+ Unrelated:
+
+ * builtin.c (do_typeof): Handle Node_array_ref also. Thanks to
+ Denis Shirokov <address@hidden> for the report.
+
2019-12-22 Arnold D. Robbins <address@hidden>
* config.guess: Updated from GNULIB.
diff --git a/builtin.c b/builtin.c
index e09a48b..f8ca037 100644
--- a/builtin.c
+++ b/builtin.c
@@ -4159,6 +4159,7 @@ do_typeof(int nargs)
}
break;
case Node_var_new:
+ case Node_array_ref:
res = "untyped";
deref = false;
break;
diff --git a/test/ChangeLog b/test/ChangeLog
index 05e60ed..3047003 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -5,6 +5,9 @@
* Makefile.am (EXTRA_DIST): New tests, stupid1 and stupid2.
* stupid1.awk, stupid1.ok: New files.
* stupid2.awk, stupid2.ok: New files.
+ * Makefile.am (EXTRA_DIST): New tests, stupid3 and stupid4.
+ * stupid3.awk, stupid3.ok: New files.
+ * stupid4.awk, stupid4.ok: New files.
2019-11-09 Alexey Pawlow <address@hidden>
diff --git a/test/Makefile.am b/test/Makefile.am
index 14e5b0a..aa64110 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1176,6 +1176,10 @@ EXTRA_DIST = \
stupid1.ok \
stupid2.awk \
stupid2.ok \
+ stupid3.awk \
+ stupid3.ok \
+ stupid4.awk \
+ stupid4.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -1395,7 +1399,7 @@ GAWK_EXT_TESTS = \
sandbox1 shadow shadowbuiltin sortfor sortfor2 sortu \
sourcesplit split_after_fpat \
splitarg4 strftfld strftime strtonum strtonum1 \
- stupid1 stupid2 \
+ stupid1 stupid2 stupid3 stupid4 \
switch2 symtab1 symtab2 \
symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \
timeout typedregex1 typedregex2 typedregex3 typedregex4 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 0fae905..9557b1e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1435,6 +1435,10 @@ EXTRA_DIST = \
stupid1.ok \
stupid2.awk \
stupid2.ok \
+ stupid3.awk \
+ stupid3.ok \
+ stupid4.awk \
+ stupid4.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -1654,7 +1658,7 @@ GAWK_EXT_TESTS = \
sandbox1 shadow shadowbuiltin sortfor sortfor2 sortu \
sourcesplit split_after_fpat \
splitarg4 strftfld strftime strtonum strtonum1 \
- stupid1 stupid2 \
+ stupid1 stupid2 stupid3 stupid4 \
switch2 symtab1 symtab2 \
symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \
timeout typedregex1 typedregex2 typedregex3 typedregex4 \
@@ -4764,6 +4768,16 @@ stupid2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+stupid4:
+ @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 6c8ebf0..e339b2b 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1921,6 +1921,16 @@ stupid2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid3:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+stupid4:
+ @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.awk b/test/stupid3.awk
new file mode 100644
index 0000000..fa57e65
--- /dev/null
+++ b/test/stupid3.awk
@@ -0,0 +1,16 @@
+BEGIN {
+ test(someidentifier)
+}
+
+
+function test(p)
+{
+ test0(p)
+ p
+ test0(p)
+}
+
+function test0(p)
+{
+ print "TYPEOF: " typeof(p)
+}
diff --git a/test/stupid3.ok b/test/stupid3.ok
new file mode 100644
index 0000000..11beb6c
--- /dev/null
+++ b/test/stupid3.ok
@@ -0,0 +1,2 @@
+TYPEOF: untyped
+TYPEOF: untyped
diff --git a/test/stupid4.awk b/test/stupid4.awk
new file mode 100644
index 0000000..8b36d0c
--- /dev/null
+++ b/test/stupid4.awk
@@ -0,0 +1,11 @@
+BEGIN {
+ test(someidentifier)
+}
+
+
+function test(a)
+{
+ print typeof(a)
+ a
+ print typeof(a)
+}
diff --git a/test/stupid4.ok b/test/stupid4.ok
new file mode 100644
index 0000000..1271dad
--- /dev/null
+++ b/test/stupid4.ok
@@ -0,0 +1,2 @@
+untyped
+untyped
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=ebe9dd1633c6f5e5d42e922a70f72829c14c193c
commit ebe9dd1633c6f5e5d42e922a70f72829c14c193c
Author: Arnold D. Robbins <address@hidden>
Date: Wed Jan 8 20:53:54 2020 +0200
Fix a bug in retrieving unset variables through SYMTAB.
diff --git a/ChangeLog b/ChangeLog
index 32aa228..496c341 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,12 @@
* interpret.h (Op_assign_concat): Handle newly created node
better.
+ Unrelated:
+
+ * interpret.h (Op_subscript): When retrieving from SYMTAB, check
+ for Node_var_new; variables can exist but have not been assigned
+ a value.
+
2019-12-22 Arnold D. Robbins <address@hidden>
* config.guess: Updated from GNULIB.
diff --git a/interpret.h b/interpret.h
index 4a7979b..d157b5b 100644
--- a/interpret.h
+++ b/interpret.h
@@ -288,6 +288,11 @@ uninitialized_scalar:
}
if (r->type == Node_var)
r = r->var_value;
+ else if (r->type == Node_var_new) {
+ // variable may exist but have never
been set.
+ r->var_value = dupnode(Nnull_string);
+ r = r->var_value;
+ }
}
if (r->type == Node_val)
diff --git a/test/ChangeLog b/test/ChangeLog
index f0eac9b..05e60ed 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -2,6 +2,9 @@
* indirectbuiltin.awk, numrange.awk, numrange.ok: Changes
after code changes.
+ * Makefile.am (EXTRA_DIST): New tests, stupid1 and stupid2.
+ * stupid1.awk, stupid1.ok: New files.
+ * stupid2.awk, stupid2.ok: New files.
2019-11-09 Alexey Pawlow <address@hidden>
@@ -10,30 +13,30 @@
2019-11-03 Arnold D. Robbins <address@hidden>
- * Makefile.am (EXTRA_DISTS): New test, fpat7.
+ * Makefile.am (EXTRA_DIST): New test, fpat7.
* fpat7.awk, fpat7.ok, fpat7.in: New files.
2019-10-13 Arnold D. Robbins <address@hidden>
- * Makefile.am (EXTRA_DISTS): New tests, typedregex5 and
+ * Makefile.am (EXTRA_DIST): New tests, typedregex5 and
typedregex6.
* typedregex5.awk, typedregex5.ok, typedregex6.in,
typedregex5.in, typedregex6.awk, typedregex6.ok: New files.
2019-09-24 Jürgen Kahrs Google <address@hidden>
- * Makefile.am (EXTRA_DISTS): New test, mpfranswer42.
+ * Makefile.am (EXTRA_DIST): New test, mpfranswer42.
* mpfranswer42.awk, mpfranswer42.ok: New files.
2019-07-23 Arnold D. Robbins <address@hidden>
- * Makefile.am (EXTRA_DISTS): Fix typos in filenames.
+ * Makefile.am (EXTRA_DIST): Fix typos in filenames.
2019-06-28 Michal Jaegermann <address@hidden>
Add backwards compatibility tests for inplace.
- * Makefile.am (EXTRA_DISTS): New tests, inplace2bcomp, inplace2bcomp.
+ * Makefile.am (EXTRA_DIST): New tests, inplace2bcomp, inplace2bcomp.
* inplace2bcomp.1.ok, test/inplace2bcomp.1.orig.ok,
test/inplace2bcomp.2.ok, test/inplace2bcomp.2.orig.ok,
test/inplace2bcomp.ok, test/inplace3bcomp.1.ok,
diff --git a/test/Makefile.am b/test/Makefile.am
index c6e33dd..14e5b0a 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1172,6 +1172,10 @@ EXTRA_DIST = \
strtonum.ok \
strtonum1.awk \
strtonum1.ok \
+ stupid1.awk \
+ stupid1.ok \
+ stupid2.awk \
+ stupid2.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -1390,7 +1394,9 @@ GAWK_EXT_TESTS = \
rsstart1 rsstart2 rsstart3 rstest6 \
sandbox1 shadow shadowbuiltin sortfor sortfor2 sortu \
sourcesplit split_after_fpat \
- splitarg4 strftfld strftime strtonum strtonum1 switch2 symtab1 symtab2 \
+ splitarg4 strftfld strftime strtonum strtonum1 \
+ stupid1 stupid2 \
+ switch2 symtab1 symtab2 \
symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \
timeout typedregex1 typedregex2 typedregex3 typedregex4 \
typedregex5 typedregex6 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 52b487b..0fae905 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1431,6 +1431,10 @@ EXTRA_DIST = \
strtonum.ok \
strtonum1.awk \
strtonum1.ok \
+ stupid1.awk \
+ stupid1.ok \
+ stupid2.awk \
+ stupid2.ok \
subamp.awk \
subamp.in \
subamp.ok \
@@ -1649,7 +1653,9 @@ GAWK_EXT_TESTS = \
rsstart1 rsstart2 rsstart3 rstest6 \
sandbox1 shadow shadowbuiltin sortfor sortfor2 sortu \
sourcesplit split_after_fpat \
- splitarg4 strftfld strftime strtonum strtonum1 switch2 symtab1 symtab2 \
+ splitarg4 strftfld strftime strtonum strtonum1 \
+ stupid1 stupid2 \
+ switch2 symtab1 symtab2 \
symtab3 symtab4 symtab5 symtab6 symtab7 symtab8 symtab9 symtab10 \
timeout typedregex1 typedregex2 typedregex3 typedregex4 \
typedregex5 typedregex6 \
@@ -4748,6 +4754,16 @@ strtonum1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+stupid2:
+ @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 627d6ec..6c8ebf0 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1911,6 +1911,16 @@ strtonum1:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+stupid1:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE: $$?
>>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+stupid2:
+ @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/stupid1.awk b/test/stupid1.awk
new file mode 100644
index 0000000..9881ac6
--- /dev/null
+++ b/test/stupid1.awk
@@ -0,0 +1,13 @@
+BEGIN {
+ abc("varname")
+ varname
+}
+
+func abc(n)
+{
+ if (n in SYMTAB) {
+ print "before"
+ is = SYMTAB[n]
+ print "after"
+ }
+}
diff --git a/test/stupid1.ok b/test/stupid1.ok
new file mode 100644
index 0000000..eecca90
--- /dev/null
+++ b/test/stupid1.ok
@@ -0,0 +1,2 @@
+before
+after
diff --git a/test/stupid2.awk b/test/stupid2.awk
new file mode 100644
index 0000000..3f6d0d8
--- /dev/null
+++ b/test/stupid2.awk
@@ -0,0 +1,5 @@
+BEGIN {
+ n = "varname"
+ SYMTAB[n]
+ varname
+}
diff --git a/test/stupid2.ok b/test/stupid2.ok
new file mode 100644
index 0000000..e69de29
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 11 +++++++++++
builtin.c | 1 +
interpret.h | 5 +++++
test/ChangeLog | 16 +++++++++++-----
test/Makefile.am | 12 +++++++++++-
test/Makefile.in | 32 +++++++++++++++++++++++++++++++-
test/Maketests | 20 ++++++++++++++++++++
test/stupid1.awk | 13 +++++++++++++
test/stupid1.ok | 2 ++
test/stupid2.awk | 5 +++++
test/{arrayprm2.ok => stupid2.ok} | 0
test/stupid3.awk | 16 ++++++++++++++++
test/stupid3.ok | 2 ++
test/stupid4.awk | 11 +++++++++++
test/stupid4.ok | 2 ++
15 files changed, 141 insertions(+), 7 deletions(-)
create mode 100644 test/stupid1.awk
create mode 100644 test/stupid1.ok
create mode 100644 test/stupid2.awk
copy test/{arrayprm2.ok => stupid2.ok} (100%)
create mode 100644 test/stupid3.awk
create mode 100644 test/stupid3.ok
create mode 100644 test/stupid4.awk
create mode 100644 test/stupid4.ok
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, master, updated. gawk-4.1.0-3866-ga2a6e54,
Arnold Robbins <=