[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4010-g177df58
From: |
Arnold Robbins |
Subject: |
[SCM] gawk branch, gawk-5.1-stable, updated. gawk-4.1.0-4010-g177df58 |
Date: |
Sun, 5 Jul 2020 14:39:28 -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.1-stable has been updated
via 177df586e992824f80bf81a1b878c7a4076caedd (commit)
via c31e4636edc5e444f9815295f373d4b1170ef260 (commit)
from f60ced696bc752cdc1a1f45ce2cc9d6149be7087 (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=177df586e992824f80bf81a1b878c7a4076caedd
commit 177df586e992824f80bf81a1b878c7a4076caedd
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Jul 5 21:39:07 2020 +0300
Make do_itrace a real variable.
diff --git a/ChangeLog b/ChangeLog
index 1777f55..8ff8f82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,14 @@
did that one get by us for so long?)
* mpfr.c (force_mpnum): Check for a + or - sign with nothing following
it.
+ Unrelated. Make do_itrace a real variable so that it's easier to
+ change the value from a debugger.
+
+ * awk.h (do_itrace): Declare.
+ (DO_ITRACE, do_itrace): Remove macros.
+ * main.c (do_itrace): Define.
+ (parse_args): Set do_itrace.
+
2020-07-03 Arnold D. Robbins <arnold@skeeve.com>
Fix a double free error with -M. Thanks to
diff --git a/awk.h b/awk.h
index eec4114..dfc25b7 100644
--- a/awk.h
+++ b/awk.h
@@ -1140,6 +1140,7 @@ extern struct block_header nextfree[];
extern bool field0_valid;
extern int do_flags;
+extern bool do_itrace; /* separate so can poke from a debugger */
extern SRCFILE *srcfiles; /* source files */
@@ -1160,7 +1161,6 @@ enum do_flag_values {
DO_PROFILE = 0x02000, /* profile the program */
DO_DEBUG = 0x04000, /* debug the program */
DO_MPFR = 0x08000, /* arbitrary-precision floating-point
math */
- DO_ITRACE = 0x10000 /* trace byte-code instructions */
};
#define do_traditional (do_flags & DO_TRADITIONAL)
@@ -1175,7 +1175,6 @@ enum do_flag_values {
#define do_sandbox (do_flags & DO_SANDBOX)
#define do_debug (do_flags & DO_DEBUG)
#define do_mpfr (do_flags & DO_MPFR)
-#define do_itrace (do_flags & DO_ITRACE)
extern bool do_optimize;
extern int use_lc_numeric;
diff --git a/main.c b/main.c
index b09b5f4..25008c3 100644
--- a/main.c
+++ b/main.c
@@ -146,6 +146,7 @@ static void set_locale_stuff(void);
static bool stopped_early = false;
int do_flags = false;
+bool do_itrace = false; /* provide simple instruction
trace */
bool do_optimize = true; /* apply default optimizations */
static int do_nostalgia = false; /* provide a blast from the past */
static int do_binary = false; /* hands off my data! */
@@ -1617,7 +1618,7 @@ parse_args(int argc, char **argv)
break;
case 'I':
- do_flags |= DO_ITRACE;
+ do_itrace = true;
break;
case 'l':
diff --git a/pc/Makefile.tst b/pc/Makefile.tst
index 9f8f579..e998e42 100644
--- a/pc/Makefile.tst
+++ b/pc/Makefile.tst
@@ -258,8 +258,8 @@ NEED_LINT = \
NEED_LINT_OLD = lintold
# List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
- mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee
mpfrmemok1 \
+ mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort
mpfrsqrt \
mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
@@ -3497,6 +3497,11 @@ mpfrbigint2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M --non-decimal-data <
"$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrcase:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrfield:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@@ -3507,6 +3512,11 @@ mpfrnegzero:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrnonum:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrnr:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=c31e4636edc5e444f9815295f373d4b1170ef260
commit c31e4636edc5e444f9815295f373d4b1170ef260
Author: Arnold D. Robbins <arnold@skeeve.com>
Date: Sun Jul 5 21:36:01 2020 +0300
MPFR bug fixes in some corner cases.
diff --git a/ChangeLog b/ChangeLog
index efe4abe..1777f55 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2020-07-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ Bug fixes in MPFR, reported by Hyunho Cho<mug896@naver.com>.
+
+ * node.c (r_dupnode): Set strndmode and also set stlen of new string.
(How
+ did that one get by us for so long?)
+ * mpfr.c (force_mpnum): Check for a + or - sign with nothing following
it.
+
2020-07-03 Arnold D. Robbins <arnold@skeeve.com>
Fix a double free error with -M. Thanks to
diff --git a/mpfr.c b/mpfr.c
index e171286..be2b81b 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -293,6 +293,14 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
else
cp1 = cp;
+ /*
+ * Maybe "+" or "-" was the field. mpg_strtoui
+ * won't check for that and set errno, so we have
+ * to check manuall.
+ */
+ if (*cp1 == '\0')
+ return false;
+
if (do_nondec)
base = get_numbase(cp1, cpend - cp1, use_locale);
diff --git a/node.c b/node.c
index bcb9a4a..04a90ad 100644
--- a/node.c
+++ b/node.c
@@ -316,11 +316,13 @@ r_dupnode(NODE *n)
r = mpg_integer();
mpz_set(r->mpg_i, n->mpg_i);
r->flags = n->flags;
+ r->strndmode = MPFR_round_mode;
} else if ((n->flags & MPFN) != 0) {
r = mpg_float();
int tval = mpfr_set(r->mpg_numbr, n->mpg_numbr, ROUND_MODE);
IEEE_FMT(r->mpg_numbr, tval);
r->flags = n->flags;
+ r->strndmode = MPFR_round_mode;
} else {
#endif
getnode(r);
@@ -343,6 +345,7 @@ r_dupnode(NODE *n)
emalloc(r->stptr, char *, n->stlen + 1, "r_dupnode");
memcpy(r->stptr, n->stptr, n->stlen);
r->stptr[n->stlen] = '\0';
+ r->stlen = n->stlen;
if ((n->flags & WSTRCUR) != 0) {
r->wstlen = n->wstlen;
emalloc(r->wstptr, wchar_t *, sizeof(wchar_t) *
(n->wstlen + 1), "r_dupnode");
diff --git a/test/ChangeLog b/test/ChangeLog
index a85ef93..d70282a 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,9 @@
+2020-07-05 Arnold D. Robbins <arnold@skeeve.com>
+
+ * Makefile.am (EXTRA_DIST): New tests, mpfrcase, mpfrnonum.
+ * mpfrcase.awk, mpfrcase.in, mpfrcase.ok,
+ mpfrnonum.awk, mpfrnonum.in, mpfrnonum.ok: New files.
+
2020-07-02 Arnold D. Robbins <arnold@skeeve.com>
* Makefile.am (EXTRA_DIST): New test, posix_compare.
diff --git a/test/Makefile.am b/test/Makefile.am
index 9be24a4..7a1b449 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -700,6 +700,9 @@ EXTRA_DIST = \
mpfrbigint2.awk \
mpfrbigint2.in \
mpfrbigint2.ok \
+ mpfrcase.awk \
+ mpfrcase.in \
+ mpfrcase.ok \
mpfrexprange.awk \
mpfrexprange.ok \
mpfrfield.awk \
@@ -711,6 +714,9 @@ EXTRA_DIST = \
mpfrmemok1.ok \
mpfrnegzero.awk \
mpfrnegzero.ok \
+ mpfrnonum.awk \
+ mpfrnonum.in \
+ mpfrnonum.ok \
mpfrnr.awk \
mpfrnr.in \
mpfrnr.ok \
@@ -1461,8 +1467,8 @@ NEED_LINT = \
NEED_LINT_OLD = lintold
# List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
- mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee
mpfrmemok1 \
+ mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort
mpfrsqrt \
mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
# List of tests that need --non-decimal-data
diff --git a/test/Makefile.in b/test/Makefile.in
index fae611a..dc691ad 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -963,6 +963,9 @@ EXTRA_DIST = \
mpfrbigint2.awk \
mpfrbigint2.in \
mpfrbigint2.ok \
+ mpfrcase.awk \
+ mpfrcase.in \
+ mpfrcase.ok \
mpfrexprange.awk \
mpfrexprange.ok \
mpfrfield.awk \
@@ -974,6 +977,9 @@ EXTRA_DIST = \
mpfrmemok1.ok \
mpfrnegzero.awk \
mpfrnegzero.ok \
+ mpfrnonum.awk \
+ mpfrnonum.in \
+ mpfrnonum.ok \
mpfrnr.awk \
mpfrnr.in \
mpfrnr.ok \
@@ -1722,8 +1728,8 @@ NEED_LINT = \
NEED_LINT_OLD = lintold
# List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
- mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrcase mpfrexprange mpfrfield mpfrieee
mpfrmemok1 \
+ mpfrnegzero mpfrnonum mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort
mpfrsqrt \
mpfrstrtonum mpgforcenum mpfruplus mpfranswer42
@@ -5113,6 +5119,11 @@ mpfrbigint2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M --non-decimal-data <
"$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrcase:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrfield:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@@ -5123,6 +5134,11 @@ mpfrnegzero:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrnonum:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrnr:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index f7aaa15..7fb3b3a 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2236,6 +2236,11 @@ mpfrbigint2:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M --non-decimal-data <
"$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrcase:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrfield:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
@@ -2246,6 +2251,11 @@ mpfrnegzero:
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M >_$@ 2>&1 || echo EXIT CODE:
$$? >>_$@
@-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+mpfrnonum:
+ @echo $@
+ @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
+ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@
+
mpfrnr:
@echo $@
@AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M < "$(srcdir)"/$@.in >_$@ 2>&1
|| echo EXIT CODE: $$? >>_$@
diff --git a/test/mpfrcase.awk b/test/mpfrcase.awk
new file mode 100644
index 0000000..4ecd75b
--- /dev/null
+++ b/test/mpfrcase.awk
@@ -0,0 +1,4 @@
+{
+ switch ($1) { case "A" : arr[1] = $1 }
+ print "value: " arr[1]
+}
diff --git a/test/mpfrcase.in b/test/mpfrcase.in
new file mode 100644
index 0000000..f70f10e
--- /dev/null
+++ b/test/mpfrcase.in
@@ -0,0 +1 @@
+A
diff --git a/test/mpfrcase.ok b/test/mpfrcase.ok
new file mode 100644
index 0000000..f101f2f
--- /dev/null
+++ b/test/mpfrcase.ok
@@ -0,0 +1 @@
+value: A
diff --git a/test/mpfrnonum.awk b/test/mpfrnonum.awk
new file mode 100644
index 0000000..52fc0d2
--- /dev/null
+++ b/test/mpfrnonum.awk
@@ -0,0 +1 @@
+{ if ($1) print "must print " $1 }
diff --git a/test/mpfrnonum.in b/test/mpfrnonum.in
new file mode 100644
index 0000000..bc8cd66
--- /dev/null
+++ b/test/mpfrnonum.in
@@ -0,0 +1,3 @@
++
+-
+1
diff --git a/test/mpfrnonum.ok b/test/mpfrnonum.ok
new file mode 100644
index 0000000..ea7201f
--- /dev/null
+++ b/test/mpfrnonum.ok
@@ -0,0 +1,3 @@
+must print +
+must print -
+must print 1
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 16 ++++++++++++++++
awk.h | 3 +--
main.c | 3 ++-
mpfr.c | 8 ++++++++
node.c | 3 +++
pc/Makefile.tst | 14 ++++++++++++--
test/ChangeLog | 6 ++++++
test/Makefile.am | 10 ++++++++--
test/Makefile.in | 20 ++++++++++++++++++--
test/Maketests | 10 ++++++++++
test/mpfrcase.awk | 4 ++++
test/{mbprintf2.ok => mpfrcase.in} | 1 -
test/mpfrcase.ok | 1 +
test/mpfrnonum.awk | 1 +
test/mpfrnonum.in | 3 +++
test/mpfrnonum.ok | 3 +++
16 files changed, 96 insertions(+), 10 deletions(-)
create mode 100644 test/mpfrcase.awk
copy test/{mbprintf2.ok => mpfrcase.in} (50%)
create mode 100644 test/mpfrcase.ok
create mode 100644 test/mpfrnonum.awk
create mode 100644 test/mpfrnonum.in
create mode 100644 test/mpfrnonum.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-4010-g177df58,
Arnold Robbins <=