summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-12-05 12:44:19 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-12-05 12:44:19 +0200
commit6189774c37616fdc52019b35b0c6108b86e795da (patch)
treefae654701aa5619ad97ae14d1a05b43ab24a4a9a
parent46fc3bdbca5829115286faa50b331bae0fd47963 (diff)
downloadmariadb-git-6189774c37616fdc52019b35b0c6108b86e795da.tar.gz
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.
-rw-r--r--storage/innobase/ibuf/ibuf0ibuf.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/innobase/ibuf/ibuf0ibuf.cc b/storage/innobase/ibuf/ibuf0ibuf.cc
index fc3c0e2042a..4f2641b7e0f 100644
--- a/storage/innobase/ibuf/ibuf0ibuf.cc
+++ b/storage/innobase/ibuf/ibuf0ibuf.cc
@@ -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);