From 831b9896d8e957580591a3cbe11dcd5ac6743ba2 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Thu, 17 Jul 2014 17:56:43 +0000 Subject: Fix fallback fesetenv and feupdateenv on FE_NOMASK_ENV (bug 17088). This patch fixes bug 17088, fallback fesetenv and feupdateenv not giving an error for an FE_NOMASK_ENV argument when it requires traps to be enabled. (This is the bug tested for by test-fenv-return.c.) Tested mips64 soft-float. [BZ #17088] * math/fesetenv.c (__fesetenv) [FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Return 1 for FE_NOMASK_ENV. * math/feupdateenv.c (__feupdateenv) [FE_NOMASK_ENV && FE_ALL_EXCEPT != 0]: Likewise. --- math/fesetenv.c | 4 ++++ math/feupdateenv.c | 4 ++++ 2 files changed, 8 insertions(+) (limited to 'math') diff --git a/math/fesetenv.c b/math/fesetenv.c index acfe5f4889..9bf42c0f6c 100644 --- a/math/fesetenv.c +++ b/math/fesetenv.c @@ -23,6 +23,10 @@ int __fesetenv (const fenv_t *envp) { +#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0 + if (envp == FE_NOMASK_ENV) + return 1; +#endif /* Nothing to do. */ return 0; } diff --git a/math/feupdateenv.c b/math/feupdateenv.c index 13d819e479..08d8ae28a4 100644 --- a/math/feupdateenv.c +++ b/math/feupdateenv.c @@ -23,6 +23,10 @@ int __feupdateenv (const fenv_t *envp) { +#if defined FE_NOMASK_ENV && FE_ALL_EXCEPT != 0 + if (envp == FE_NOMASK_ENV) + return 1; +#endif /* Nothing to do. */ return 0; } -- cgit v1.2.3