mirror of
https://github.com/MariaDB/server.git
synced 2026-01-06 05:22:24 +03:00
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 accessing the block descriptor state would make the warning disappear.
This commit is contained in:
@@ -2160,17 +2160,21 @@ void buf_pool_t::watch_unset(const page_id_t id, buf_pool_t::hash_chain &chain)
|
||||
buf_page_t *w;
|
||||
{
|
||||
transactional_lock_guard<page_hash_latch> g{page_hash.lock_get(chain)};
|
||||
/* The page must exist because watch_set() increments buf_fix_count. */
|
||||
/* The page must exist because watch_set() did fix(). */
|
||||
w= page_hash.get(id, chain);
|
||||
const auto state= w->state();
|
||||
ut_ad(state >= buf_page_t::UNFIXED);
|
||||
ut_ad(~buf_page_t::LRU_MASK & state);
|
||||
ut_ad(w->in_page_hash);
|
||||
if (state != buf_page_t::UNFIXED + 1 || !watch_is_sentinel(*w))
|
||||
if (!watch_is_sentinel(*w))
|
||||
{
|
||||
w->unfix();
|
||||
no_watch:
|
||||
ut_d(const auto s=) w->unfix();
|
||||
ut_ad(~buf_page_t::LRU_MASK & s);
|
||||
w= nullptr;
|
||||
}
|
||||
const auto state= w->state();
|
||||
ut_ad(~buf_page_t::LRU_MASK & state);
|
||||
ut_ad(state >= buf_page_t::UNFIXED);
|
||||
if (state != buf_page_t::UNFIXED + 1)
|
||||
goto no_watch;
|
||||
}
|
||||
|
||||
if (!w)
|
||||
|
||||
Reference in New Issue
Block a user