Commit 95d04ddb authored by marko's avatar marko

branches/zip: Fix a bug that was introduced in r2123.

buf_block_is_uncompressed(): Check that the pointer is aligned.  Use the
C modulus operator % instead of ut_align_offset(), because sizeof(buf_block_t)
is not guaranteed to be a power of 2.
parent 15d8cc6e
...@@ -1671,7 +1671,7 @@ buf_block_is_uncompressed( ...@@ -1671,7 +1671,7 @@ buf_block_is_uncompressed(
ut_ad(mutex_own(&buf_pool->mutex)); ut_ad(mutex_own(&buf_pool->mutex));
if (UNIV_UNLIKELY(ut_align_offset(block, sizeof *block) != 0)) { if (UNIV_UNLIKELY((((ulint) block) % sizeof *block) != 0)) {
/* The pointer should be aligned. */ /* The pointer should be aligned. */
return(FALSE); return(FALSE);
} }
......
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