diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-09-27 14:51:46 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-09-27 14:51:46 +0300 |
commit | 4f9eee14c2ec4eafc3af923712c5f48a23d8e58b (patch) | |
tree | 745e42493e5534f114e2e559fd7b0391b49efea5 | |
parent | 8c5752ed884408c41609d3ae471c04afaf1fb40a (diff) | |
parent | da86689ae1669c27f0bf0c975d5e3d1e10058dfd (diff) | |
download | egawk-4f9eee14c2ec4eafc3af923712c5f48a23d8e58b.tar.gz egawk-4f9eee14c2ec4eafc3af923712c5f48a23d8e58b.tar.bz2 egawk-4f9eee14c2ec4eafc3af923712c5f48a23d8e58b.zip |
Merge branch 'gawk-4.2-stable'
-rwxr-xr-x | ChangeLog | 6 | ||||
-rw-r--r-- | mpfr.c | 2 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 7 | ||||
-rw-r--r-- | test/Makefile.in | 12 | ||||
-rw-r--r-- | test/Maketests | 5 | ||||
-rw-r--r-- | test/mpfrbigint2.awk | 3 | ||||
-rw-r--r-- | test/mpfrbigint2.in | 1 | ||||
-rw-r--r-- | test/mpfrbigint2.ok | 3 |
9 files changed, 39 insertions, 5 deletions
@@ -1,3 +1,9 @@ +2018-09-27 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * mpfr.c (force_mpnum): Check that base is 10 also before + computing MPG integer. Found based on bug report from + <phuclv90@gmail.com>. + 2018-09-26 Arnold D. Robbins <arnold@skeeve.com> Add more lint checks. @@ -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 4eb36e08..664db91c 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2018-09-27 Arnold D. Robbins <arnold@skeeve.com> + + * Maefile.am (EXTRA_DIST): New test: mpfrbigint2. + * mpfrbigint2.awk, mpfrbigint2.in, mpfrbigint2.ok: New files. + 2018-09-21 Arnold D. Robbins <arnold@skeeve.com> * Maefile.am (EXTRA_DIST): New test: trailbs. diff --git a/test/Makefile.am b/test/Makefile.am index 3eca3e97..bcfb135c 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 3a6f5649..c547d187 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 $@.awk -M >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrbigint2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M --non-decimal-data < "$(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: $$? >>_$@ diff --git a/test/Maketests b/test/Maketests index e24fed82..fd6a2713 100644 --- a/test/Maketests +++ b/test/Maketests @@ -2084,6 +2084,11 @@ mpfrbigint: @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +mpfrbigint2: + @echo $@ + @AWKPATH="$(srcdir)" $(AWK) -f $@.awk -M --non-decimal-data < "$(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: $$? >>_$@ diff --git a/test/mpfrbigint2.awk b/test/mpfrbigint2.awk new file mode 100644 index 00000000..42adefaa --- /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 00000000..9113a79c --- /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 00000000..2a0d2077 --- /dev/null +++ b/test/mpfrbigint2.ok @@ -0,0 +1,3 @@ +146727939091013295464431 +146727939091013295464431 +146727939091013295464431 |