From 43aee93d2b0e49762ce6884b174314776848a5d2 Mon Sep 17 00:00:00 2001 From: Cheng Chang Date: Mon, 23 Mar 2020 20:12:38 -0700 Subject: [PATCH] Initialize scratch to nullptr explicitly to make clang analyzer happy (#6577) Summary: `scratch` is not initialized in `Align` because it will be set outside of it. But clang analyzer is strict on initializing it before return. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6577 Test Plan: make analyze Reviewed By: siying Differential Revision: D20607303 Pulled By: cheng-chang fbshipit-source-id: 2843d759345a057a8e122178d30b90deff0f9b2a --- file/random_access_file_reader.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/file/random_access_file_reader.cc b/file/random_access_file_reader.cc index f596aa019..b18cf4c06 100644 --- a/file/random_access_file_reader.cc +++ b/file/random_access_file_reader.cc @@ -163,6 +163,7 @@ FSReadRequest Align(const FSReadRequest& r, size_t alignment) { req.offset = static_cast( TruncateToPageBoundary(alignment, static_cast(r.offset))); req.len = Roundup(End(r), alignment) - req.offset; + req.scratch = nullptr; return req; }