Commit 6189774c authored by Marko Mäkelä's avatar Marko Mäkelä

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 87839258.
parent 46fc3bdb
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment