Skip to content

Commit 6deaff5

Browse files
committed
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.
1 parent 3f7040f commit 6deaff5

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

storage/innobase/include/page0types.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,10 @@ struct page_zip_des_t
113113
#endif /* UNIV_DEBUG */
114114

115115
void clear() {
116-
memset((void*) this, 0, sizeof(data) + sizeof(uint32_t));
117-
ut_d(m_start = 0);
118-
ut_d(m_external = false);
116+
/* Clear everything except the member "fix". */
117+
memset((void*) this, 0,
118+
reinterpret_cast<char*>(&fix)
119+
- reinterpret_cast<char*>(this));
119120
}
120121

121122
private:

0 commit comments

Comments
 (0)