Commit 095d656d authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-15053 fixup: MSAN use-of-uninitialized-value

buf_page_init_for_read(): Initialize the output parameter of
buf_buddy_alloc().
parent 6877ef9a
......@@ -431,9 +431,9 @@ buf_buddy_alloc_from(void* buf, ulint i, ulint j)
return(buf);
}
/** Allocate a block.
@param[in] i index of buf_pool.zip_free[] or BUF_BUDDY_SIZES
@param[out] lru whether buf_pool.mutex was temporarily released
/** Allocate a ROW_FORMAT=COMPRESSED block.
@param i index of buf_pool.zip_free[] or BUF_BUDDY_SIZES
@param lru assigned to true if buf_pool.mutex was temporarily released
@return allocated block, never NULL */
byte *buf_buddy_alloc_low(ulint i, bool *lru)
{
......
......@@ -86,7 +86,6 @@ static buf_page_t* buf_page_init_for_read(ulint mode, const page_id_t page_id,
ulint zip_size, bool unzip)
{
mtr_t mtr;
bool lru= false;
if (mode == BUF_READ_IBUF_PAGES_ONLY)
{
......@@ -169,7 +168,7 @@ static buf_page_t* buf_page_init_for_read(ulint mode, const page_id_t page_id,
block descriptor has been added to buf_pool.LRU and
buf_pool.page_hash. */
block->page.zip.data= static_cast<page_zip_t*>
(buf_buddy_alloc(zip_size, &lru));
(buf_buddy_alloc(zip_size));
/* To maintain the invariant
block->in_unzip_LRU_list == block->page.belongs_to_unzip_LRU()
......@@ -187,7 +186,7 @@ static buf_page_t* buf_page_init_for_read(ulint mode, const page_id_t page_id,
control block (bpage), in order to avoid the
invocation of buf_buddy_relocate_block() on
uninitialized data. */
bool lru;
bool lru= false;
void *data= buf_buddy_alloc(zip_size, &lru);
rw_lock_x_lock(hash_lock);
......
......@@ -50,15 +50,14 @@ buf_buddy_get_slot(ulint size)
}
/** Allocate a ROW_FORMAT=COMPRESSED block.
@param[in] i index of buf_pool.zip_free[] or BUF_BUDDY_SIZES
@param[out] lru whether buf_pool.mutex was temporarily released
@param i index of buf_pool.zip_free[] or BUF_BUDDY_SIZES
@param lru assigned to true if buf_pool.mutex was temporarily released
@return allocated block, never NULL */
byte *buf_buddy_alloc_low(ulint i, bool *lru) MY_ATTRIBUTE((malloc));
/** Allocate a ROW_FORMAT=COMPRESSED block.
The caller must not hold buf_pool.mutex.
@param[in] size compressed page size
@param[out] lru whether buf_pool.mutex was temporarily released
@param size compressed page size in bytes
@param lru assigned to true if buf_pool.mutex was temporarily released
@return allocated block, never NULL */
inline byte *buf_buddy_alloc(ulint size, bool *lru= nullptr)
{
......
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