diff --git a/src/util/bitset.h b/src/util/bitset.h index 3c90a2aaf19..bc324bc435f 100644 --- a/src/util/bitset.h +++ b/src/util/bitset.h @@ -282,6 +282,7 @@ __bitset_clear_range(BITSET_WORD *r, int start, int end) static inline unsigned __bitset_extract(const BITSET_WORD *r, unsigned start, unsigned count) { + assert(count <= BITSET_WORDBITS); unsigned shift = start % BITSET_WORDBITS; BITSET_WORD lower = r[BITSET_BITWORD(start)] >> shift; BITSET_WORD upper = shift ? r[BITSET_BITWORD(start + count - 1)] << (BITSET_WORDBITS - shift) : 0;