1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-29 11:41:21 +03:00

Avoid spurious failures from <fenv.h> fallback functions (bug 15654).

This commit is contained in:
Joseph Myers
2013-06-20 19:10:44 +00:00
parent bfcacbdec0
commit c91e082525
12 changed files with 44 additions and 16 deletions

View File

@ -1,3 +1,19 @@
2013-06-20 Joseph Myers <joseph@codesourcery.com>
[BZ #15654]
* math/fedisblxcpt.c (fedisableexcept): Return 0.
* math/feenablxcpt.c (feenableexcept): Return 0 for argument 0.
* math/fegetenv.c (__fegetenv): Return 0.
* math/fegetexcept.c (fegetexcept): Return 0.
* math/fegetround.c (fegetround) [FE_TONEAREST]: Return
FE_TONEAREST.
* math/feholdexcpt.c (feholdexcept): Return 0.
* math/fesetenv.c (__fesetenv): Return 0.
* math/fesetround.c (fesetround) [FE_TONEAREST]: Return 0 for
argument FE_TONEAREST.
* math/feupdateenv.c (__feupdateenv): Return 0.
* math/fgetexcptflg.c (__fegetexceptflag): Return 0.
2013-06-18 Roland McGrath <roland@hack.frob.com> 2013-06-18 Roland McGrath <roland@hack.frob.com>
* elf/rtld-Rules (rtld-compile-command.S): New variable. * elf/rtld-Rules (rtld-compile-command.S): New variable.

2
NEWS
View File

@ -20,7 +20,7 @@ Version 2.18
15361, 15366, 15380, 15381, 15394, 15395, 15405, 15406, 15409, 15416, 15361, 15366, 15380, 15381, 15394, 15395, 15405, 15406, 15409, 15416,
15418, 15419, 15423, 15424, 15426, 15429, 15431, 15432, 15441, 15442, 15418, 15419, 15423, 15424, 15426, 15429, 15431, 15432, 15441, 15442,
15448, 15465, 15480, 15485, 15488, 15490, 15492, 15493, 15497, 15506, 15448, 15465, 15480, 15485, 15488, 15490, 15492, 15493, 15497, 15506,
15529, 15536, 15553, 15577, 15583, 15618, 15627, 15631. 15529, 15536, 15553, 15577, 15583, 15618, 15627, 15631, 15654.
* CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla * CVE-2013-0242 Buffer overrun in regexp matcher has been fixed (Bugzilla
#15078). #15078).

View File

@ -22,7 +22,7 @@
int int
fedisableexcept (int excepts) fedisableexcept (int excepts)
{ {
/* Signal failure. */ /* All exception traps are disabled. */
return -1; return 0;
} }
stub_warning (fedisableexcept) stub_warning (fedisableexcept)

View File

@ -22,7 +22,10 @@
int int
feenableexcept (int excepts) feenableexcept (int excepts)
{ {
/* Signal failure. */ /* Signal failure if any exception traps are to be enabled. */
return -1; if (excepts != 0)
return -1;
else
return 0;
} }
stub_warning (feenableexcept) stub_warning (feenableexcept)

View File

@ -23,8 +23,8 @@
int int
__fegetenv (fenv_t *envp) __fegetenv (fenv_t *envp)
{ {
/* This always fails. */ /* Nothing to do. */
return 1; return 0;
} }
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetenv, __old_fegetenv) strong_alias (__fegetenv, __old_fegetenv)

View File

@ -22,7 +22,7 @@
int int
fegetexcept (void) fegetexcept (void)
{ {
/* Signal failure. */ /* All exception traps are disabled. */
return -1; return 0;
} }
stub_warning (fegetexcept) stub_warning (fegetexcept)

View File

@ -22,6 +22,10 @@
int int
fegetround (void) fegetround (void)
{ {
#ifdef FE_TONEAREST
return FE_TONEAREST;
#else
return 0; return 0;
#endif
} }
stub_warning (fegetround) stub_warning (fegetround)

View File

@ -22,7 +22,8 @@
int int
feholdexcept (fenv_t *envp) feholdexcept (fenv_t *envp)
{ {
return 1; /* Signal failure. */ /* No exception traps to disable and no state to save. */
return 0;
} }
libm_hidden_def (feholdexcept) libm_hidden_def (feholdexcept)
stub_warning (feholdexcept) stub_warning (feholdexcept)

View File

@ -23,8 +23,8 @@
int int
__fesetenv (const fenv_t *envp) __fesetenv (const fenv_t *envp)
{ {
/* This always fails. */ /* Nothing to do. */
return 1; return 0;
} }
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fesetenv, __old_fesetenv) strong_alias (__fesetenv, __old_fesetenv)

View File

@ -22,7 +22,11 @@
int int
fesetround (int round) fesetround (int round)
{ {
#ifdef FE_TONEAREST
return (round == FE_TONEAREST) ? 0 : 1;
#else
return 1; /* Signal we are unable to set the direction. */ return 1; /* Signal we are unable to set the direction. */
#endif
} }
libm_hidden_def (fesetround) libm_hidden_def (fesetround)
stub_warning (fesetround) stub_warning (fesetround)

View File

@ -23,8 +23,8 @@
int int
__feupdateenv (const fenv_t *envp) __feupdateenv (const fenv_t *envp)
{ {
/* This always fails. */ /* Nothing to do. */
return 1; return 0;
} }
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__feupdateenv, __old_feupdateenv) strong_alias (__feupdateenv, __old_feupdateenv)

View File

@ -23,8 +23,8 @@
int int
__fegetexceptflag (fexcept_t *flagp, int excepts) __fegetexceptflag (fexcept_t *flagp, int excepts)
{ {
/* This always fails. */ /* Nothing to do. */
return 1; return 0;
} }
#if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2) #if SHLIB_COMPAT (libm, GLIBC_2_1, GLIBC_2_2)
strong_alias (__fegetexceptflag, __old_fegetexceptflag) strong_alias (__fegetexceptflag, __old_fegetexceptflag)