From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1921) id 64A2E3864862; Fri, 24 Jun 2022 05:42:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 64A2E3864862 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Sebastian Huber To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix undefined behavior: left-shifting into the sign bit. X-Act-Checkin: newlib-cygwin X-Git-Author: Konstantin Belousov X-Git-Refname: refs/heads/master X-Git-Oldrev: de1380c36b9018f8f2f4f52de47939c75e26818f X-Git-Newrev: 5e7a2b174ae1a54dd5cdd3c19455c6b81d5133f8 Message-Id: <20220624054224.64A2E3864862@sourceware.org> Date: Fri, 24 Jun 2022 05:42:24 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jun 2022 05:42:24 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D5e7a2b174ae= 1a54dd5cdd3c19455c6b81d5133f8 commit 5e7a2b174ae1a54dd5cdd3c19455c6b81d5133f8 Author: Konstantin Belousov Date: Mon Dec 23 20:18:05 2019 +0000 Fix undefined behavior: left-shifting into the sign bit. =20 Reviewed by: dim, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D22898 Diff: --- newlib/libc/sys/rtems/include/sys/bitset.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libc/sys/rtems/include/sys/bitset.h b/newlib/libc/sys/r= tems/include/sys/bitset.h index a1fd8b316..9ff18f4f3 100644 --- a/newlib/libc/sys/rtems/include/sys/bitset.h +++ b/newlib/libc/sys/rtems/include/sys/bitset.h @@ -44,7 +44,7 @@ #define __constexpr_cond(expr) (__builtin_constant_p((expr)) && (expr)) =20 #define __bitset_mask(_s, n) \ - (1L << (__constexpr_cond(__bitset_words((_s)) =3D=3D 1) ? \ + (1UL << (__constexpr_cond(__bitset_words((_s)) =3D=3D 1) ? \ (__size_t)(n) : ((n) % _BITSET_BITS))) =20 #define __bitset_word(_s, n) \