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-298


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-2983-gc7d9eb0
Date: Fri, 22 Jun 2018 11:49:07 -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  c7d9eb0bb45e11da69c420488aa7af865f2ed5bd (commit)
      from  edaf82c330629586b1158a3dec407d53084b02e3 (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=c7d9eb0bb45e11da69c420488aa7af865f2ed5bd

commit c7d9eb0bb45e11da69c420488aa7af865f2ed5bd
Author: Andrew J. Schorr <address@hidden>
Date:   Fri Jun 22 11:48:23 2018 -0400

    Huge numeric values that overflow should convert to infinity instead of 
zero.

diff --git a/ChangeLog b/ChangeLog
index 58038f8..629faec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2018-06-22         Andrew J. Schorr      <address@hidden>
+
+       * node.c (r_force_number): If strtod returns ERANGE, accept the
+       value as being numeric instead of forcing it to zero. The impact
+       is that huge string values that overflow IEEE 754 limits will now
+       be converted to inf or -inf instead of 0. Thanks to Daniel
+       Pettet for reporting this issue.
+
 2018-06-17         Arnold D. Robbins     <address@hidden>
 
        Fix a corner case with EPIPE to stdout/stderr.
diff --git a/node.c b/node.c
index fcd2bf3..984cec8 100644
--- a/node.c
+++ b/node.c
@@ -140,7 +140,8 @@ r_force_number(NODE *n)
                *cpend = save;
        }
 
-       if (errno == 0) {
+       if (errno == 0 || errno == ERANGE) {
+               errno = 0;      /* reset in case of ERANGE */
                if (ptr == cpend)
                        goto goodnum;
                /* else keep the leading numeric value without updating flags */
diff --git a/test/ChangeLog b/test/ChangeLog
index a257520..0b41abb 100644
--- a/test/ChangeLog
+++ b/test/ChangeLog
@@ -1,3 +1,8 @@
+2018-06-22         Andrew J. Schorr     <address@hidden>
+
+       * Makefile.am (EXTRA_DIST): Add files for numrange.
+       * numrange.awk, numrange.ok: New files.
+
 2018-05-24         Arnold D. Robbins     <address@hidden>
 
        * noeffect.awk, noeffect.ok: Updated.
diff --git a/test/Makefile.am b/test/Makefile.am
index af0d47d..e4cca53 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -761,6 +761,8 @@ EXTRA_DIST = \
        numindex.awk \
        numindex.in \
        numindex.ok \
+       numrange.awk \
+       numrange.ok \
        numstr1.awk \
        numstr1.ok \
        numsubstr.awk \
@@ -1248,7 +1250,7 @@ BASIC_TESTS = \
        manglprm math membug1 memleak messages minusstr mmap8k \
        nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep 
\
        nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl noparms \
-       nors nulinsrc nulrsend numindex numstr1 numsubstr \
+       nors nulinsrc nulrsend numindex numrange numstr1 numsubstr \
        octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofmtstrnum ofs1 onlynl \
        opasnidx opasnslf \
        paramasfunc1 paramasfunc2 paramdup paramres paramtyp paramuninitglobal \
diff --git a/test/Makefile.in b/test/Makefile.in
index edf4d64..b987b1c 100644
--- a/test/Makefile.in
+++ b/test/Makefile.in
@@ -1019,6 +1019,8 @@ EXTRA_DIST = \
        numindex.awk \
        numindex.in \
        numindex.ok \
+       numrange.awk \
+       numrange.ok \
        numstr1.awk \
        numstr1.ok \
        numsubstr.awk \
@@ -1506,7 +1508,7 @@ BASIC_TESTS = \
        manglprm math membug1 memleak messages minusstr mmap8k \
        nasty nasty2 negexp negrange nested nfldstr nfloop nfneg nfset nlfldsep 
\
        nlinstr nlstrina noeffect nofile nofmtch noloop1 noloop2 nonl noparms \
-       nors nulinsrc nulrsend numindex numstr1 numsubstr \
+       nors nulinsrc nulrsend numindex numrange numstr1 numsubstr \
        octsub ofmt ofmta ofmtbig ofmtfidl ofmts ofmtstrnum ofs1 onlynl \
        opasnidx opasnslf \
        paramasfunc1 paramasfunc2 paramdup paramres paramtyp paramuninitglobal \
@@ -3300,6 +3302,11 @@ numindex:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+numrange:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 numstr1:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/Maketests b/test/Maketests
index 1759ee5..5e5fa5e 100644
--- a/test/Maketests
+++ b/test/Maketests
@@ -658,6 +658,11 @@ numindex:
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  < 
"$(srcdir)"/address@hidden >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@
        @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
 
+numrange:
+       @echo $@
+       @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
+       @-$(CMP) "$(srcdir)"/address@hidden _$@ && rm -f _$@
+
 numstr1:
        @echo $@
        @AWKPATH="$(srcdir)" $(AWK) -f address@hidden  >_$@ 2>&1 || echo EXIT 
CODE: $$? >>_$@
diff --git a/test/numrange.awk b/test/numrange.awk
new file mode 100644
index 0000000..3ad2cab
--- /dev/null
+++ b/test/numrange.awk
@@ -0,0 +1,5 @@
+BEGIN {
+    n = split("-1.2e+931 1.2e+931", a)
+    for (i=1; i<=n; ++i)
+        print a[i], +a[i]
+}
diff --git a/test/numrange.ok b/test/numrange.ok
new file mode 100644
index 0000000..006da13
--- /dev/null
+++ b/test/numrange.ok
@@ -0,0 +1,2 @@
+-1.2e+931 -inf
+1.2e+931 inf

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

Summary of changes:
 ChangeLog         | 8 ++++++++
 node.c            | 3 ++-
 test/ChangeLog    | 5 +++++
 test/Makefile.am  | 4 +++-
 test/Makefile.in  | 9 ++++++++-
 test/Maketests    | 5 +++++
 test/numrange.awk | 5 +++++
 test/numrange.ok  | 2 ++
 8 files changed, 38 insertions(+), 3 deletions(-)
 create mode 100644 test/numrange.awk
 create mode 100644 test/numrange.ok


hooks/post-receive
-- 
gawk



reply via email to

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