gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-305


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-3055-gda86689
Date: Thu, 27 Sep 2018 07:51:29 -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-4.2-stable has been updated
       via  da86689ae1669c27f0bf0c975d5e3d1e10058dfd (commit)
      from  c25c88f583c984112055fa091d357c1b8538d5d8 (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=da86689ae1669c27f0bf0c975d5e3d1e10058dfd

commit da86689ae1669c27f0bf0c975d5e3d1e10058dfd
Author: Arnold D. Robbins <address@hidden>
Date:   Thu Sep 27 14:51:00 2018 +0300

    Fix problem with MPFR conversion to int from hex numbers.

diff --git a/ChangeLog b/ChangeLog
index 358962d..1028e82 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-09-27         Andrew J. Schorr      <address@hidden>
+
+       * mpfr.c (force_mpnum): Check that base is 10 also before
+       computing MPG integer.  Found based on bug report from
+       <address@hidden>.
+
 2018-09-26         Arnold D. Robbins     <address@hidden>
 
        Add more lint checks.
diff --git a/mpfr.c b/mpfr.c
index b6e9c16..8478570 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -296,7 +296,7 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
        if (do_nondec)
                base = get_numbase(cp1, cpend - cp1, use_locale);
 
-       if (! mpg_maybe_float(cp1, use_locale)) {
+       if (base != 10 || ! mpg_maybe_float(cp1, use_locale)) {
                mpg_zero(n);
                errno = 0;
                mpg_strtoui(n->mpg_i, cp1, cpend - cp1, & ptr, base);
diff --git a/test/ChangeLog b/test/ChangeLog
index 4eb36e0..664db91 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2018-09-27         Arnold D. Robbins     <address@hidden>
+
+       * Maefile.am (EXTRA_DIST): New test: mpfrbigint2.
+       * mpfrbigint2.awk, mpfrbigint2.in, mpfrbigint2.ok: New files.
+
 2018-09-21         Arnold D. Robbins     <address@hidden>
 
        * Maefile.am (EXTRA_DIST): New test: trailbs.
diff --git a/test/Makefile.am b/test/Makefile.am
index 3eca3e9..bcfb135 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -659,6 +659,9 @@ EXTRA_DIST = \
        mmap8k.ok \
        mpfrbigint.awk \
        mpfrbigint.ok \
+       mpfrbigint2.awk \
+       mpfrbigint2.in \
+       mpfrbigint2.ok \
        mpfrexprange.awk \
        mpfrexprange.ok \
        mpfrfield.awk \
@@ -1348,12 +1351,12 @@ NEED_LINT = \
 NEED_LINT_OLD = lintold
 
 # List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
        mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
        mpfrstrtonum mpgforcenum mpfruplus
 
 # List of tests that need --non-decimal-data
-NEED_NONDEC = nondec2 intarray forcenum
+NEED_NONDEC = mpfrbigint2 nondec2 intarray forcenum
 
 # List of tests that need --posix
 NEED_POSIX = printf0 posix2008sub paramasfunc1 paramasfunc2 muldimposix
diff --git a/test/Makefile.in b/test/Makefile.in
index 3a6f564..c547d18 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -917,6 +917,9 @@ EXTRA_DIST = \
        mmap8k.ok \
        mpfrbigint.awk \
        mpfrbigint.ok \
+       mpfrbigint2.awk \
+       mpfrbigint2.in \
+       mpfrbigint2.ok \
        mpfrexprange.awk \
        mpfrexprange.ok \
        mpfrfield.awk \
@@ -1604,13 +1607,13 @@ NEED_LINT = \
 NEED_LINT_OLD = lintold
 
 # List of tests that must be run with -M
-NEED_MPFR = mpfrbigint mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
+NEED_MPFR = mpfrbigint mpfrbigint2 mpfrexprange mpfrfield mpfrieee mpfrmemok1 \
        mpfrnegzero mpfrnr mpfrrem mpfrrnd mpfrrndeval mpfrsort mpfrsqrt \
        mpfrstrtonum mpgforcenum mpfruplus
 
 
 # List of tests that need --non-decimal-data
-NEED_NONDEC = nondec2 intarray forcenum
+NEED_NONDEC = mpfrbigint2 nondec2 intarray forcenum
 
 # List of tests that need --posix
 NEED_POSIX = printf0 posix2008sub paramasfunc1 paramasfunc2 muldimposix
@@ -4741,6 +4744,11 @@ mpfrbigint:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  -M >_$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+mpfrbigint2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  -M --non-decimal-data < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 mpfrfield:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  -M < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index e24fed8..fd6a271 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -2084,6 +2084,11 @@ mpfrbigint:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  -M >_$@ 2>&1 || echo 
EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+mpfrbigint2:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  -M --non-decimal-data < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 mpfrfield:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  -M < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
diff --git a/test/mpfrbigint2.awk b/test/mpfrbigint2.awk
new file mode 100644
index 0000000..42adefa
--- /dev/null
+++ b/test/mpfrbigint2.awk
@@ -0,0 +1,3 @@
+BEGIN { print 0x1F12233445566778DFEF + 0 }
+BEGIN { print strtonum("0x1F12233445566778DFEF") }
+{ print $1 + 0 }
diff --git a/test/mpfrbigint2.in b/test/mpfrbigint2.in
new file mode 100644
index 0000000..9113a79
--- /dev/null
+++ b/test/mpfrbigint2.in
@@ -0,0 +1 @@
+0x1F12233445566778DFEF
diff --git a/test/mpfrbigint2.ok b/test/mpfrbigint2.ok
new file mode 100644
index 0000000..2a0d207
--- /dev/null
+++ b/test/mpfrbigint2.ok
@@ -0,0 +1,3 @@
+146727939091013295464431
+146727939091013295464431
+146727939091013295464431

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

Summary of changes:
 ChangeLog            |  6 ++++++
 mpfr.c               |  2 +-
 test/ChangeLog       |  5 +++++
 test/Makefile.am     |  7 +++++--
 test/Makefile.in     | 12 ++++++++++--
 test/Maketests       |  5 +++++
 test/mpfrbigint2.awk |  3 +++
 test/mpfrbigint2.in  |  1 +
 test/mpfrbigint2.ok  |  3 +++
 9 files changed, 39 insertions(+), 5 deletions(-)
 create mode 100644 test/mpfrbigint2.awk
 create mode 100644 test/mpfrbigint2.in
 create mode 100644 test/mpfrbigint2.ok


hooks/post-receive
-- 
gawk



reply via email to

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