From owner-svn-src-all@freebsd.org Wed Sep 23 12:54:44 2020 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1E843F8F9B; Wed, 23 Sep 2020 12:54:43 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BxJ6W21P5z4nL2; Wed, 23 Sep 2020 12:54:43 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1BB6910A3A; Wed, 23 Sep 2020 12:54:43 +0000 (UTC) (envelope-from arichardson@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08NCsgfh097070; Wed, 23 Sep 2020 12:54:42 GMT (envelope-from arichardson@FreeBSD.org) Received: (from arichardson@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08NCsgWI097069; Wed, 23 Sep 2020 12:54:42 GMT (envelope-from arichardson@FreeBSD.org) Message-Id: <202009231254.08NCsgWI097069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arichardson set sender to arichardson@FreeBSD.org using -f From: Alex Richardson Date: Wed, 23 Sep 2020 12:54:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366075 - head/contrib/byacc X-SVN-Group: head X-SVN-Commit-Author: arichardson X-SVN-Commit-Paths: head/contrib/byacc X-SVN-Commit-Revision: 366075 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Sep 2020 12:54:44 -0000 Author: arichardson Date: Wed Sep 23 12:54:42 2020 New Revision: 366075 URL: https://svnweb.freebsd.org/changeset/base/366075 Log: byacc: fix UBSan signed shift range error I've submitted this patch upstream, so apply this to contrib/ until a new version containing this change has been released. Reviewed By: jkim Differential Revision: https://reviews.freebsd.org/D26505 Modified: head/contrib/byacc/closure.c head/contrib/byacc/warshall.c Modified: head/contrib/byacc/closure.c ============================================================================== --- head/contrib/byacc/closure.c Wed Sep 23 12:54:37 2020 (r366074) +++ head/contrib/byacc/closure.c Wed Sep 23 12:54:42 2020 (r366075) @@ -87,7 +87,7 @@ set_first_derives(void) k = 0; } - if (cword & (unsigned)(1 << k)) + if (cword & (1u << k)) { rp = derives[j]; while ((rule = *rp++) >= 0) @@ -151,7 +151,7 @@ closure(Value_t *nucleus, int n) { for (i = 0; i < BITS_PER_WORD; ++i) { - if (word & (unsigned)(1 << i)) + if (word & (1u << i)) { itemno = rrhs[ruleno + i]; while (csp < csend && *csp < itemno) Modified: head/contrib/byacc/warshall.c ============================================================================== --- head/contrib/byacc/warshall.c Wed Sep 23 12:54:37 2020 (r366074) +++ head/contrib/byacc/warshall.c Wed Sep 23 12:54:42 2020 (r366075) @@ -28,7 +28,7 @@ transitive_closure(unsigned *R, int n) while (rowj < relend) { - if (*ccol & (unsigned)(1 << i)) + if (*ccol & (1u << i)) { rp = rowi; rend = rowj + rowsize; @@ -70,7 +70,7 @@ reflexive_transitive_closure(unsigned *R, int n) rp = R; while (rp < relend) { - *rp |= (unsigned)(1 << i); + *rp |= (1u << i); if (++i >= BITS_PER_WORD) { i = 0;