diff options
author | Marko Mäkelä <marko.makela@oracle.com> | 2010-05-25 15:37:48 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@oracle.com> | 2010-05-25 15:37:48 +0300 |
commit | 10b06978fe77507c923f6b9174cb6c8352055df7 (patch) | |
tree | 5c253ccd25490e835fa7610b75b38c38ee35e010 /storage | |
parent | 1a892fa2063a8da2480209108462bb939a45e98c (diff) | |
download | mariadb-git-10b06978fe77507c923f6b9174cb6c8352055df7.tar.gz |
Suppress bogus Valgrind warnings about buf_buddy_relocate()
accessing uninitialized memory in Valgrind-instrumented builds.
Diffstat (limited to 'storage')
-rw-r--r-- | storage/innodb_plugin/buf/buf0buddy.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/storage/innodb_plugin/buf/buf0buddy.c b/storage/innodb_plugin/buf/buf0buddy.c index 07753cb8a60..ee5a569c3ff 100644 --- a/storage/innodb_plugin/buf/buf0buddy.c +++ b/storage/innodb_plugin/buf/buf0buddy.c @@ -442,11 +442,15 @@ buf_buddy_relocate( pool), so there is nothing wrong about this. The mach_read_from_4() calls here will only trigger bogus Valgrind memcheck warnings in UNIV_DEBUG_VALGRIND builds. */ - bpage = buf_page_hash_get( - mach_read_from_4((const byte*) src - + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID), - mach_read_from_4((const byte*) src - + FIL_PAGE_OFFSET)); + ulint space = mach_read_from_4( + (const byte*) src + FIL_PAGE_ARCH_LOG_NO_OR_SPACE_ID); + ulint page_no = mach_read_from_4( + (const byte*) src + FIL_PAGE_OFFSET); + /* Suppress Valgrind warnings about conditional jump + on uninitialized value. */ + UNIV_MEM_VALID(&space, sizeof space); + UNIV_MEM_VALID(&page_no, sizeof page_no); + bpage = buf_page_hash_get(space, page_no); if (!bpage || bpage->zip.data != src) { /* The block has probably been freshly |