[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4905-g2848045a
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4905-g2848045a |
Date: |
Wed, 14 Sep 2022 15:40:45 -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, gawk-5.2-stable has been updated
via 2848045aed5ccfd7b582808288f7fcc18d319952 (commit)
via baab183439ff4e0c6b77d62156d447e61fc1dcfb (commit)
from 7eacf279a6ff4bff560ff49a8a2a9c531658096c (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=2848045aed5ccfd7b582808288f7fcc18d319952
commit 2848045aed5ccfd7b582808288f7fcc18d319952
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Sep 14 22:33:39 2022 +0300
Additional fix for Node_elem_new.
diff --git a/ChangeLog b/ChangeLog
index cd9d9fcd..5c27caff 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * interpret.h (r_interpret): For the `push' opcodes, don't upref
+ the Node_elem_new. Instead, convert the very original value to
+ Node_var and use elem_new_to_scalar for the local variable.
+ See test case elemnew3.awk. Thanks to Pascal Terjan <pterjan@gmail.com>
+ for the report and test case.
+
2022-09-14 Arnold D. Robbins <arnold@skeeve.com>
* interpret.h (r_interpret): For the `push' opcodes, upref
diff --git a/interpret.h b/interpret.h
index 268655b2..26010ada 100644
--- a/interpret.h
+++ b/interpret.h
@@ -213,7 +213,7 @@ top:
case Node_var_new:
uninitialized_scalar:
if (op != Op_push_arg_untyped) {
- /* convert untyped to scalar */
+ /* convert very original untyped to
scalar */
m->type = Node_var;
m->var_value = dupnode(Nnull_string);
}
@@ -222,6 +222,7 @@ uninitialized_scalar:
_("reference to uninitialized
argument `%s'") :
_("reference to uninitialized
variable `%s'"),
save_symbol->vname);
+ // set up local param by value
if (op != Op_push_arg_untyped)
m = dupnode(Nnull_string);
UPREF(m);
@@ -230,15 +231,20 @@ uninitialized_scalar:
case Node_elem_new:
if (op != Op_push_arg_untyped) {
- /* convert untyped to scalar */
- m = elem_new_to_scalar(m);
+ /* convert very original untyped to
scalar */
+ m->type = Node_var;
+ m->var_value = dupnode(Nnull_string);
}
if (do_lint)
lintwarn(isparam ?
_("reference to uninitialized
argument `%s'") :
_("reference to uninitialized
variable `%s'"),
save_symbol->vname);
- UPREF(m);
+ // set up local param by value
+ if (op != Op_push_arg_untyped) {
+ m = elem_new_to_scalar(m);
+ }
+
PUSH(m);
break;
diff --git a/pc/ChangeLog b/pc/ChangeLog
index a78ccfcb..67ee4d2d 100644
--- a/pc/ChangeLog
+++ b/pc/ChangeLog
@@ -1,3 +1,7 @@
+2022-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.tst: Regenerated.
+
2022-09-04 Arnold D. Robbins <arnold@skeeve.com>
* 5.2.0: Release tar ball made.
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 269ec8a0..9e40cd2a 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -190,7 +190,8 @@ GAWK_EXT_TESTS = \
binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
- dfacheck1 dumpvars errno exit fieldwdth forcenum fpat1 fpat2 \
+ dfacheck1 dumpvars elemnew1 elemnew2 elemnew3 \
+ errno exit fieldwdth forcenum fpat1 fpat2 \
fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
@@ -2735,6 +2736,21 @@ dfacheck1:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+elemnew1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+elemnew2:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+elemnew3:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
exit:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/ChangeLog b/test/ChangeLog
index ea08edee..434cbd9c 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,7 +1,8 @@
2022-09-14 Arnold D. Robbins <arnold@skeeve.com>
- * Makefile.am (EXTRA_DIST): New test: elemnew1.
- * elemnew1.awk, elemnew1.ok: New files.
+ * Makefile.am (EXTRA_DIST): New tests: elemnew1, elemnew2, elemnew3.
+ * elemnew1.awk, elemnew1.ok, elemnew2.awk, elemnew2.ok,
+ elemnew3.awk, elemnew3.ok: New files.
2022-09-04 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/test/Makefile.am b/test/Makefile.am
index 8a5c3c49..8b0a24e8 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -284,6 +284,10 @@ EXTRA_DIST = \
dynlj.ok \
elemnew1.awk \
elemnew1.ok \
+ elemnew2.awk \
+ elemnew2.ok \
+ elemnew3.awk \
+ elemnew3.ok \
escapebrace.awk \
escapebrace.in \
escapebrace.ok \
@@ -1482,7 +1486,8 @@ GAWK_EXT_TESTS = \
binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
- dfacheck1 dumpvars elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
+ dfacheck1 dumpvars elemnew1 elemnew2 elemnew3 \
+ errno exit fieldwdth forcenum fpat1 fpat2 \
fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
diff --git a/test/Makefile.in b/test/Makefile.in
index a4fb1cc1..9240a42e 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -552,6 +552,10 @@ EXTRA_DIST = \
dynlj.ok \
elemnew1.awk \
elemnew1.ok \
+ elemnew2.awk \
+ elemnew2.ok \
+ elemnew3.awk \
+ elemnew3.ok \
escapebrace.awk \
escapebrace.in \
escapebrace.ok \
@@ -1750,7 +1754,8 @@ GAWK_EXT_TESTS = \
binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
- dfacheck1 dumpvars elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
+ dfacheck1 dumpvars elemnew1 elemnew2 elemnew3 \
+ errno exit fieldwdth forcenum fpat1 fpat2 \
fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
@@ -4483,6 +4488,16 @@ elemnew1:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+elemnew2:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+elemnew3:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
exit:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 90828e7f..f7e749c0 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1437,6 +1437,16 @@ elemnew1:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+elemnew2:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
+elemnew3:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
exit:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/elemnew2.awk b/test/elemnew2.awk
new file mode 100644
index 00000000..08e72391
--- /dev/null
+++ b/test/elemnew2.awk
@@ -0,0 +1,6 @@
+function set_val(old) {
+ old[1] = 42
+}
+BEGIN {
+ a[0] = set_val(a[0])
+}
diff --git a/test/elemnew2.ok b/test/elemnew2.ok
new file mode 100644
index 00000000..d6f2d78a
--- /dev/null
+++ b/test/elemnew2.ok
@@ -0,0 +1,2 @@
+gawk: elemnew2.awk:5: fatal: attempt to use array `a["0"]' in a scalar context
+EXIT CODE: 2
diff --git a/test/elemnew3.awk b/test/elemnew3.awk
new file mode 100644
index 00000000..39ac9a8c
--- /dev/null
+++ b/test/elemnew3.awk
@@ -0,0 +1,8 @@
+function foo(x)
+{
+ if (x == int(x))
+ return (int(x) != 0)
+}
+BEGIN {
+ foo(P["bar"])
+}
diff --git a/test/elemnew3.ok b/test/elemnew3.ok
new file mode 100644
index 00000000..e69de29b
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=baab183439ff4e0c6b77d62156d447e61fc1dcfb
commit baab183439ff4e0c6b77d62156d447e61fc1dcfb
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Wed Sep 14 21:08:59 2022 +0300
Fix a bug with Node_elem_new.
diff --git a/ChangeLog b/ChangeLog
index 5fb25483..cd9d9fcd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2022-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * interpret.h (r_interpret): For the `push' opcodes, upref
+ the Node_elem_new. See test case elemnew1. Thanks to
+ Emanuel Attila Czirai <corre.a.buscar@gmail.com> for the report,
+ and to Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
+ for the fix.
+
2022-09-04 Arnold D. Robbins <arnold@skeeve.com>
* 5.2.0: Release tar ball made.
diff --git a/interpret.h b/interpret.h
index 57d060e6..268655b2 100644
--- a/interpret.h
+++ b/interpret.h
@@ -238,6 +238,7 @@ uninitialized_scalar:
_("reference to uninitialized
argument `%s'") :
_("reference to uninitialized
variable `%s'"),
save_symbol->vname);
+ UPREF(m);
PUSH(m);
break;
diff --git a/test/ChangeLog b/test/ChangeLog
index a73637bf..ea08edee 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2022-09-14 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): New test: elemnew1.
+ * elemnew1.awk, elemnew1.ok: New files.
+
2022-09-04 Arnold D. Robbins <arnold@skeeve.com>
* 5.2.0: Release tar ball made.
diff --git a/test/Makefile.am b/test/Makefile.am
index ab06974c..8a5c3c49 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -282,6 +282,8 @@ EXTRA_DIST = \
dumpvars.ok \
dynlj.awk \
dynlj.ok \
+ elemnew1.awk \
+ elemnew1.ok \
escapebrace.awk \
escapebrace.in \
escapebrace.ok \
@@ -1480,7 +1482,7 @@ GAWK_EXT_TESTS = \
binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
- dfacheck1 dumpvars errno exit fieldwdth forcenum fpat1 fpat2 \
+ dfacheck1 dumpvars elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
diff --git a/test/Makefile.in b/test/Makefile.in
index 834feb09..a4fb1cc1 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -550,6 +550,8 @@ EXTRA_DIST = \
dumpvars.ok \
dynlj.awk \
dynlj.ok \
+ elemnew1.awk \
+ elemnew1.ok \
escapebrace.awk \
escapebrace.in \
escapebrace.ok \
@@ -1748,7 +1750,7 @@ GAWK_EXT_TESTS = \
binmode1 charasbytes clos1way clos1way2 clos1way3 clos1way4 \
clos1way5 clos1way6 colonwarn commas crlf dbugeval dbugeval2 \
dbugeval3 dbugtypedre1 dbugtypedre2 delsub devfd devfd1 devfd2 \
- dfacheck1 dumpvars errno exit fieldwdth forcenum fpat1 fpat2 \
+ dfacheck1 dumpvars elemnew1 errno exit fieldwdth forcenum fpat1 fpat2 \
fpat3 fpat4 fpat5 fpat6 fpat7 fpat8 fpat9 fpatnull fsfwfs functab1 \
functab2 functab3 functab6 funlen fwtest fwtest2 fwtest3 fwtest4 \
fwtest5 fwtest6 fwtest7 fwtest8 genpot gensub gensub2 gensub3 \
@@ -4476,6 +4478,11 @@ dfacheck1:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+elemnew1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
exit:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 3a667af8..90828e7f 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -1432,6 +1432,11 @@ dfacheck1:
@-AWKPATH="$(srcdir)" $(AWK) -f $@.awk < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+elemnew1:
+ @echo $@
+ @-AWKPATH="$(srcdir)" $(AWK) -f $@.awk >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
exit:
@echo $@
@-$(LOCALES) AWK="$(AWKPROG)" "$(srcdir)"/$@.sh > _$@ 2>&1 || echo
EXIT CODE: $$? >>_$@
diff --git a/test/elemnew1.awk b/test/elemnew1.awk
new file mode 100644
index 00000000..58dc9fcd
--- /dev/null
+++ b/test/elemnew1.awk
@@ -0,0 +1,9 @@
+function add_flags(old) {
+ if (old)
+ return 0
+ if (!old)
+ return 1
+}
+BEGIN {
+ a[0]=add_flags(a[0])
+}
diff --git a/test/elemnew1.ok b/test/elemnew1.ok
new file mode 100644
index 00000000..e69de29b
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 16 ++++++++++++++++
interpret.h | 13 ++++++++++---
pc/ChangeLog | 4 ++++
pc/Makefile.tst | 18 +++++++++++++++++-
test/ChangeLog | 6 ++++++
test/Makefile.am | 9 ++++++++-
test/Makefile.in | 24 +++++++++++++++++++++++-
test/Maketests | 15 +++++++++++++++
test/elemnew1.awk | 9 +++++++++
test/{arrayprm2.ok => elemnew1.ok} | 0
test/elemnew2.awk | 6 ++++++
test/elemnew2.ok | 2 ++
test/elemnew3.awk | 8 ++++++++
test/{arrayprm2.ok => elemnew3.ok} | 0
14 files changed, 124 insertions(+), 6 deletions(-)
create mode 100644 test/elemnew1.awk
copy test/{arrayprm2.ok => elemnew1.ok} (100%)
create mode 100644 test/elemnew2.awk
create mode 100644 test/elemnew2.ok
create mode 100644 test/elemnew3.awk
copy test/{arrayprm2.ok => elemnew3.ok} (100%)
hooks/post-receive
--
gawk
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [SCM] gawk branch, gawk-5.2-stable, updated. gawk-4.1.0-4905-g2848045a,
Arnold Robbins <=