About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/util/bitset.h
diff options
context:
space:
mode:
authorConnor Abbott <cwabbott0@gmail.com>2022-01-10 14:01:34 +0100
committerMarge Bot <emma+marge@anholt.net>2022-03-10 17:15:29 +0000
commit410e746198b498efdb9c37a63a0b8aad67469a4c (patch)
tree129a1142bf296650f718b7253c01e6930d0968c3 /src/util/bitset.h
parent72b32d83fbf7d195310ef5aecba4a136f305aed5 (diff)
util/bitset: Fix off-by-one in __bitset_set_range
Fixes: b3b03e33c9f ("util/bitset: add BITSET_SET_RANGE(..)") Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14107>
Diffstat (limited to 'src/util/bitset.h')
-rw-r--r--src/util/bitset.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/bitset.h b/src/util/bitset.h
index 279ad553e79..d8ec1af67ad 100644
--- a/src/util/bitset.h
+++ b/src/util/bitset.h
@@ -208,7 +208,7 @@ __bitset_shl(BITSET_WORD *x, unsigned amount, unsigned n)
static inline void
__bitset_set_range(BITSET_WORD *r, unsigned start, unsigned end)
{
- const unsigned size = end - start;
+ const unsigned size = end - start + 1;
const unsigned start_mod = start % BITSET_WORDBITS;
if (start_mod + size <= BITSET_WORDBITS) {