mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-21 20:40:05 +00:00
Fix cproj handling of (finite, NaN) arguments (bug 15531).
This commit is contained in:
parent
0716c4fc9f
commit
c980f2f4fe
@ -1,5 +1,13 @@
|
||||
2013-08-20 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
[BZ #15531]
|
||||
* math/s_cproj.c (__cproj): Only return an infinity if one part of
|
||||
argument is infinite.
|
||||
* math/s_cprojf.c (__cprojf): Likewise.
|
||||
* math/s_cprojl.c (__cprojl): Likewise.
|
||||
* sysdeps/ieee754/ldbl-128ibm/s_cprojl.c (__cprojl): Likewise.
|
||||
* math/libm-test.inc (cproj_test_data): Add more tests.
|
||||
|
||||
* sysdeps/unix/sysv/linux/mmap64.c: Include <string.h>.
|
||||
|
||||
* sysdeps/unix/sysv/linux/mmap64.c (__mmap64)
|
||||
|
2
NEWS
2
NEWS
@ -9,7 +9,7 @@ Version 2.19
|
||||
|
||||
* The following bugs are resolved with this release:
|
||||
|
||||
14699, 15749
|
||||
14699, 15531, 15749
|
||||
|
||||
* CVE-2013-4237 The readdir_r function could write more than NAME_MAX bytes
|
||||
to the d_name member of struct dirent, or omit the terminating NUL
|
||||
|
@ -7066,11 +7066,51 @@ static const struct test_c_c_data cproj_test_data[] =
|
||||
|
||||
TEST_c_c (cproj, qnan_value, qnan_value, qnan_value, qnan_value, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, plus_zero, qnan_value, plus_zero, qnan_value, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_zero, qnan_value, minus_zero, qnan_value, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, qnan_value, plus_zero, qnan_value, plus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, qnan_value, minus_zero, qnan_value, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, 1.0, qnan_value, 1.0, qnan_value, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, -1.0, qnan_value, -1.0, qnan_value, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, qnan_value, 1.0, qnan_value, 1.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, qnan_value, -1.0, qnan_value, -1.0, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, plus_infty, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, plus_infty, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, plus_infty, plus_zero, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, plus_infty, minus_zero, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, plus_zero, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, minus_zero, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, plus_zero, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, plus_zero, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_zero, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_zero, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, plus_infty, 1.0, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, plus_infty, -1.0, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, 1.0, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, -1.0, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, 1.0, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, 1.0, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, -1.0, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, -1.0, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, plus_infty, qnan_value, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, plus_infty, -qnan_value, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, qnan_value, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, minus_infty, -qnan_value, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, qnan_value, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, qnan_value, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, -qnan_value, plus_infty, plus_infty, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, -qnan_value, minus_infty, plus_infty, minus_zero, NO_INEXACT_EXCEPTION),
|
||||
|
||||
TEST_c_c (cproj, 1.0, 0.0, 1.0, 0.0, NO_INEXACT_EXCEPTION),
|
||||
TEST_c_c (cproj, 2.0, 3.0, 2.0, 3.0, NO_INEXACT_EXCEPTION),
|
||||
};
|
||||
|
@ -24,9 +24,7 @@
|
||||
__complex__ double
|
||||
__cproj (__complex__ double x)
|
||||
{
|
||||
if (isnan (__real__ x) && isnan (__imag__ x))
|
||||
return x;
|
||||
else if (!isfinite (__real__ x) || !isfinite (__imag__ x))
|
||||
if (__isinf_ns (__real__ x) || __isinf_ns (__imag__ x))
|
||||
{
|
||||
__complex__ double res;
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
__complex__ float
|
||||
__cprojf (__complex__ float x)
|
||||
{
|
||||
if (isnan (__real__ x) && isnan (__imag__ x))
|
||||
return x;
|
||||
else if (!isfinite (__real__ x) || !isfinite (__imag__ x))
|
||||
if (__isinf_nsf (__real__ x) || __isinf_nsf (__imag__ x))
|
||||
{
|
||||
__complex__ float res;
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
__complex__ long double
|
||||
__cprojl (__complex__ long double x)
|
||||
{
|
||||
if (isnan (__real__ x) && isnan (__imag__ x))
|
||||
return x;
|
||||
else if (!isfinite (__real__ x) || !isfinite (__imag__ x))
|
||||
if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x))
|
||||
{
|
||||
__complex__ long double res;
|
||||
|
||||
|
@ -24,9 +24,7 @@
|
||||
__complex__ long double
|
||||
__cprojl (__complex__ long double x)
|
||||
{
|
||||
if (isnan (__real__ x) && isnan (__imag__ x))
|
||||
return x;
|
||||
else if (!isfinite (__real__ x) || !isfinite (__imag__ x))
|
||||
if (__isinf_nsl (__real__ x) || __isinf_nsl (__imag__ x))
|
||||
{
|
||||
__complex__ long double res;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user