From ee239df351f486a23793e637125965a3c0c3987f Mon Sep 17 00:00:00 2001 From: Andrew Kryczka Date: Mon, 11 Oct 2021 13:04:25 -0700 Subject: [PATCH] Initialize cache dumper `DumpUnit` in constructor (#9014) Summary: Should fix clang-analyze: ``` utilities/cache_dump_load_impl.cc:296:38: warning: The left operand of '!=' is a garbage value while (io_s.ok() && dump_unit.type != CacheDumpUnitType::kFooter) { ~~~~~~~~~~~~~~ ^ ``` Pull Request resolved: https://github.com/facebook/rocksdb/pull/9014 Reviewed By: zhichao-cao Differential Revision: D31546912 Pulled By: ajkr fbshipit-source-id: a2e0dc7874e8c1c6abf190862b5d49e6a6ad6d01 --- utilities/cache_dump_load_impl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/utilities/cache_dump_load_impl.h b/utilities/cache_dump_load_impl.h index f799863b2..28dba671d 100644 --- a/utilities/cache_dump_load_impl.h +++ b/utilities/cache_dump_load_impl.h @@ -79,6 +79,8 @@ struct DumpUnit { // address of the begin of the block in this string. void* value; + DumpUnit() { reset(); } + void reset() { timestamp = 0; type = CacheDumpUnitType::kBlockTypeMax;