Skip to content

Commit 6baad30

Browse files
committed
select: bloom: Squash undefined behaviour sanitiser errors
Signed 32-bit shift of 1<<31 is undefined.
1 parent 3ac1c5e commit 6baad30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/select/bloom.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static inline void css_bloom_add_hash(css_bloom bloom[CSS_BLOOM_SIZE],
6868
unsigned int bit = hash & 0x1f; /* Top 5 bits */
6969
unsigned int index = (hash >> 5) & INDEX_BITS_N; /* Next N bits */
7070

71-
bloom[index] |= (1 << bit);
71+
bloom[index] |= (1u << bit);
7272
}
7373

7474

@@ -85,7 +85,7 @@ static inline bool css_bloom_has_hash(const css_bloom bloom[CSS_BLOOM_SIZE],
8585
unsigned int bit = hash & 0x1f; /* Top 5 bits */
8686
unsigned int index = (hash >> 5) & INDEX_BITS_N; /* Next N bits */
8787

88-
return (bloom[index] & (1 << bit));
88+
return (bloom[index] & (1u << bit));
8989
}
9090

9191

0 commit comments

Comments
 (0)