Commit c14f60a7 authored by Marko Mäkelä's avatar Marko Mäkelä

Fix g++-12 -O2 -Wstringop-overflow

buf_pool_t::watch_unset(): Reorder some code so that
no warning will be emitted in CMAKE_BUILD_TYPE=RelWithDebInfo.
It is unclear why invoking watch_is_sentinel() before
buf_fix_count() would make the warning disappear.
parent d62b0368
...@@ -2383,10 +2383,8 @@ void buf_pool_t::watch_unset(const page_id_t id) ...@@ -2383,10 +2383,8 @@ void buf_pool_t::watch_unset(const page_id_t id)
page_hash_latch *hash_lock= page_hash.lock<true>(fold); page_hash_latch *hash_lock= page_hash.lock<true>(fold);
/* The page must exist because watch_set() increments buf_fix_count. */ /* The page must exist because watch_set() increments buf_fix_count. */
buf_page_t *w= page_hash_get_low(id, fold); buf_page_t *w= page_hash_get_low(id, fold);
const auto buf_fix_count= w->buf_fix_count();
ut_ad(buf_fix_count);
const bool must_remove= buf_fix_count == 1 && watch_is_sentinel(*w);
ut_ad(w->in_page_hash); ut_ad(w->in_page_hash);
const bool must_remove= watch_is_sentinel(*w) && w->buf_fix_count() == 1;
if (!must_remove) if (!must_remove)
w->unfix(); w->unfix();
hash_lock->write_unlock(); hash_lock->write_unlock();
......
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