Skip to content
Permalink
Browse files
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 8783925.
  • Loading branch information
dr-m committed Dec 5, 2019
1 parent 46fc3bd commit 6189774
Showing 1 changed file with 1 addition and 1 deletion.
@@ -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);

0 comments on commit 6189774

Please sign in to comment.