diff options
author | Alex Richardson <arichardson@FreeBSD.org> | 2020-09-23 12:54:42 +0000 |
---|---|---|
committer | Alex Richardson <arichardson@FreeBSD.org> | 2020-09-23 12:54:42 +0000 |
commit | d1e106f262db9d009289fc2cc17b3d614ee6de8c (patch) | |
tree | 8e6f7c4c9e14daddff624dc6b6cf6fa736b402d9 /contrib | |
parent | 1e266857ad7f3fa9681654af44d3699252904215 (diff) | |
download | src-d1e106f262db9d009289fc2cc17b3d614ee6de8c.tar.gz src-d1e106f262db9d009289fc2cc17b3d614ee6de8c.zip |
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
Notes
Notes:
svn path=/head/; revision=366075
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/byacc/closure.c | 4 | ||||
-rw-r--r-- | contrib/byacc/warshall.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/contrib/byacc/closure.c b/contrib/byacc/closure.c index f5c3f04d74fd..61848ebf5658 100644 --- a/contrib/byacc/closure.c +++ b/contrib/byacc/closure.c @@ -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) diff --git a/contrib/byacc/warshall.c b/contrib/byacc/warshall.c index efb7cf447974..b5298da347e5 100644 --- a/contrib/byacc/warshall.c +++ b/contrib/byacc/warshall.c @@ -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; |