Suppress two CLANG Analyze warning (#4291)

Summary:
Suppress two CLANG analyze warnings. They don't seem to be real bugs
Pull Request resolved: https://github.com/facebook/rocksdb/pull/4291

Differential Revision: D9407333

Pulled By: siying

fbshipit-source-id: 2ed63d88fa0b217fdccb1572d7508467c2203dc8
main
Siying Dong 6 years ago committed by Facebook Github Bot
parent d116a1725d
commit dc064f302e
  1. 6
      table/block_based_table_reader.cc
  2. 1
      table/block_fetcher.cc

@ -2840,7 +2840,6 @@ Status BlockBasedTable::DumpTable(WritableFile* out_file,
" ");
out_file->Append(table_properties->ToString("\n ", ": ").c_str());
out_file->Append("\n");
}
// Output Filter blocks
if (!rep_->filter && !table_properties->filter_policy_name.empty()) {
@ -2857,8 +2856,8 @@ Status BlockBasedTable::DumpTable(WritableFile* out_file,
Slice dummy_comp_dict;
BlockFetcher block_fetcher(
rep_->file.get(), nullptr /* prefetch_buffer */, rep_->footer,
ReadOptions(), handle, &block, rep_->ioptions, false /*decompress*/,
dummy_comp_dict /*compression dict*/,
ReadOptions(), handle, &block, rep_->ioptions,
false /*decompress*/, dummy_comp_dict /*compression dict*/,
rep_->persistent_cache_options);
s = block_fetcher.ReadBlockContents();
if (!s.ok()) {
@ -2870,6 +2869,7 @@ Status BlockBasedTable::DumpTable(WritableFile* out_file,
}
}
}
}
if (rep_->filter) {
out_file->Append(
"Filter Details:\n"

@ -169,6 +169,7 @@ void BlockFetcher::GetBlockContents() {
// page can be either uncompressed or compressed, the buffer either stack
// or heap provided. Refer to https://github.com/facebook/rocksdb/pull/4096
if (got_from_prefetch_buffer_ || used_buf_ == &stack_buf_[0]) {
assert(used_buf_ != heap_buf_.get());
heap_buf_.reset(new char[block_size_ + kBlockTrailerSize]);
memcpy(heap_buf_.get(), used_buf_, block_size_ + kBlockTrailerSize);
}

Loading…
Cancel
Save