ibuf_get_volume_buffered_hash(): Use a proper type cast
On 64-bit systems, the constant 1 would be 32-bit (int or unsigned) by default. Cast the constant to ulint before shifting to avoid a -fsanitize=undefined warning or any potential overflow.
This commit is contained in:
parent
9f57e595b4
commit
a436e349df
@ -2895,8 +2895,7 @@ ibuf_get_volume_buffered_hash(
|
||||
fold = ut_fold_binary(data, len);
|
||||
|
||||
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
|
||||
bitmask = static_cast<ulint>(
|
||||
1 << (fold % (CHAR_BIT * sizeof(*hash))));
|
||||
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
|
||||
|
||||
if (*hash & bitmask) {
|
||||
|
||||
|
@ -2935,8 +2935,7 @@ ibuf_get_volume_buffered_hash(
|
||||
fold = ut_fold_binary(data, len);
|
||||
|
||||
hash += (fold / (CHAR_BIT * sizeof *hash)) % size;
|
||||
bitmask = static_cast<ulint>(
|
||||
1 << (fold % (CHAR_BIT * sizeof(*hash))));
|
||||
bitmask = static_cast<ulint>(1) << (fold % (CHAR_BIT * sizeof(*hash)));
|
||||
|
||||
if (*hash & bitmask) {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user