From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/13320 Path: news.gmane.org!.POSTED!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] fix fesetround error checking Date: Wed, 26 Sep 2018 23:18:40 +0200 Message-ID: <20180926211840.GI10209@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MAH+hnPXVZWQ5cD/" X-Trace: blaine.gmane.org 1537996608 7108 195.159.176.226 (26 Sep 2018 21:16:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Sep 2018 21:16:48 +0000 (UTC) User-Agent: Mutt/1.10.1 (2018-07-13) To: musl@lists.openwall.com Original-X-From: musl-return-13336-gllmg-musl=m.gmane.org@lists.openwall.com Wed Sep 26 23:16:44 2018 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1g5HAp-0001lq-OH for gllmg-musl@m.gmane.org; Wed, 26 Sep 2018 23:16:43 +0200 Original-Received: (qmail 13817 invoked by uid 550); 26 Sep 2018 21:18:53 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 13782 invoked from network); 26 Sep 2018 21:18:52 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline Xref: news.gmane.org gmane.linux.lib.musl.general:13320 Archived-At: --MAH+hnPXVZWQ5cD/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline simple fix, not sure why this was wrong. --MAH+hnPXVZWQ5cD/ Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="0001-fix-fesetround-error-checking.patch" >From b9200510d08fa1b6aba8d1ee4ffbdf8892397cfa Mon Sep 17 00:00:00 2001 From: Szabolcs Nagy Date: Mon, 10 Sep 2018 19:06:21 +0000 Subject: [PATCH] fix fesetround error checking Rounding modes are not bit flags, but arbitrary non-negative integers. --- src/fenv/fesetround.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/fenv/fesetround.c b/src/fenv/fesetround.c index 50e58f11..4e2f164d 100644 --- a/src/fenv/fesetround.c +++ b/src/fenv/fesetround.c @@ -7,18 +7,17 @@ hidden int __fesetround(int); int fesetround(int r) { - if (r & ~( - FE_TONEAREST + if (r != FE_TONEAREST #ifdef FE_DOWNWARD - |FE_DOWNWARD + && r != FE_DOWNWARD #endif #ifdef FE_UPWARD - |FE_UPWARD + && r != FE_UPWARD #endif #ifdef FE_TOWARDZERO - |FE_TOWARDZERO + && r != FE_TOWARDZERO #endif - )) + ) return -1; return __fesetround(r); } -- 2.18.0 --MAH+hnPXVZWQ5cD/--