This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug math/14551] [ldbl-128ibm] strtold overflow handling for IBM long double


https://sourceware.org/bugzilla/show_bug.cgi?id=14551

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
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 "GNU C Library master sources".

The branch, master has been updated
       via  909f8e14dbe4073d75a776b4a9f50e5cc450f161 (commit)
      from  21378ae0d390c45ef382e8c95cc3593845ebb6ea (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 -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=909f8e14dbe4073d75a776b4a9f50e5cc450f161

commit 909f8e14dbe4073d75a776b4a9f50e5cc450f161
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Nov 13 12:03:46 2015 +0000

    Fix ldbl-128ibm strtold overflow handling (bug 14551).

    For ldbl-128ibm, if the result of strtold overflows in the final
    conversion from MPN to IBM long double (because the exponent for a
    106-bit IEEE result is 1023 but the high part would end up as
    0x1p1024, which overflows), that conversion code fails to handle this
    and produces an invalid long double value (high part infinite, low
    part not zero) without raising exceptions or setting errno.  This
    patch adds an explicit check for this case to ensure an appropriate
    result is returned in a way that ensures the right exceptions are
    raised, with errno set.

    Tested for powerpc.

        [BZ #14551]
        * sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c: Include <errno.h>.
        (__mpn_construct_long_double): If high part overflows to infinity,
        set errno and recompute overflowed result of the correct sign.
        * sysdeps/ieee754/ldbl-128ibm/Makefile
        [$(subdir) = stdlib] (tests): Add tst-strtold-ldbl-128ibm.
        [$(subdir) = stdlib] ($(objpfx)tst-strtold-ldbl-128ibm): Depend on
        $(libm).
        * sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c: New file.

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

Summary of changes:
 ChangeLog                                          |   12 +++
 sysdeps/ieee754/ldbl-128ibm/Makefile               |    5 +
 sysdeps/ieee754/ldbl-128ibm/mpn2ldbl.c             |    9 ++
 .../ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c  |   85 ++++++++++++++++++++
 4 files changed, 111 insertions(+), 0 deletions(-)
 create mode 100644 sysdeps/ieee754/ldbl-128ibm/tst-strtold-ldbl-128ibm.c

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]