diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index eab3fc556..34afa5b85 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +2012-05-02 Corinna Vinschen + + * fenv.cc (fesetround): Fix test for valid input parameter. + (fesetprec): Ditto. + 2012-04-30 Christopher Faylor * fhandler.h (PIPE_ADD_PID): Define new flag. diff --git a/winsup/cygwin/fenv.cc b/winsup/cygwin/fenv.cc index 0f1f29b73..66513e9d2 100755 --- a/winsup/cygwin/fenv.cc +++ b/winsup/cygwin/fenv.cc @@ -1,6 +1,6 @@ /* fenv.cc - Copyright 2010, 2011 Red Hat, Inc. + Copyright 2010, 2011, 2012 Red Hat, Inc. This file is part of Cygwin. @@ -349,7 +349,7 @@ fesetround (int round) unsigned int mxcsr = 0; /* Will succeed for any valid value of the input parameter. */ - if (round & ~(FE_CW_ROUND_MASK >> FE_CW_PREC_SHIFT)) + if (round < FE_TONEAREST || round > FE_TOWARDZERO) return EINVAL; /* Get control words. */ @@ -395,7 +395,7 @@ fesetprec (int prec) unsigned short cw; /* Will succeed for any valid value of the input parameter. */ - if (prec & ~(FE_CW_PREC_MASK >> FE_CW_PREC_SHIFT) || prec == FE_RESERVEDPREC) + if (prec < FE_SINGLEPREC || prec > FE_EXTENDEDPREC) return EINVAL; /* Get control word. */