Commit 6deaff58 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-27058 fixup: GCC 11 -march=i686 -Warray-bounds

page_zip_des_t::clear(): Avoid a bogus GCC warning with
some pointer arithmetics. Yes, storing the unrelated member "fix"
in this object is ugly, but it avoids memory alignment overhead
on 64-bit architectures.
parent 3f7040fa
......@@ -113,9 +113,10 @@ struct page_zip_des_t
#endif /* UNIV_DEBUG */
void clear() {
memset((void*) this, 0, sizeof(data) + sizeof(uint32_t));
ut_d(m_start = 0);
ut_d(m_external = false);
/* Clear everything except the member "fix". */
memset((void*) this, 0,
reinterpret_cast<char*>(&fix)
- reinterpret_cast<char*>(this));
}
private:
......
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