MDEV-21174: Fix undefined behaviour

ibuf_bitmap_page_set_bits(): Do not attempt to shift by a negative amount.
This bug was introduced in commit 87839258f86196dfca1d3af2a947e570e13eeb94.
This commit is contained in:
Marko Mäkelä 2019-12-05 12:44:19 +02:00
parent 46fc3bdbca
commit 6189774c37

View File

@ -657,7 +657,7 @@ ibuf_bitmap_page_set_bits(
ut_ad(bit_offset + 1 < 8);
ut_ad(val <= 3);
b &= ~(3U << bit_offset);
b |= (val & 2) << (bit_offset - 1)
b |= ((val & 2) >> 1) << bit_offset
| (val & 1) << (bit_offset + 1);
} else {
ut_ad(val <= 1);