From 00f8016b36af00b1dfd81b6e580ee49ebbbcf4c1 Mon Sep 17 00:00:00 2001 From: sdong Date: Fri, 3 Apr 2020 15:42:56 -0700 Subject: [PATCH] Fix clang anaylze warning caused by #6262 (#6641) Summary: https://github.com/facebook/rocksdb/pull/6262 causes CLANG analyze to complain. Add assertion to suppress the warning. Pull Request resolved: https://github.com/facebook/rocksdb/pull/6641 Test Plan: Run "clang analyze" and make sure it passes. Reviewed By: anand1976 Differential Revision: D20841722 fbshipit-source-id: 5fa6e0c5cfe7a822214c9b898a408df59d4fd2cd --- table/block_based/block_based_table_builder.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/table/block_based/block_based_table_builder.cc b/table/block_based/block_based_table_builder.cc index fb4a7eb03..65571ab95 100644 --- a/table/block_based/block_based_table_builder.cc +++ b/table/block_based/block_based_table_builder.cc @@ -781,10 +781,12 @@ void BlockBasedTableBuilder::Flush() { if (r->data_block.empty()) return; if (r->compression_opts.parallel_threads > 1 && r->state == Rep::State::kUnbuffered) { - ParallelCompressionRep::BlockRep* block_rep; + ParallelCompressionRep::BlockRep* block_rep = nullptr; r->pc_rep->block_rep_pool.pop(block_rep); + assert(block_rep != nullptr); r->data_block.Finish(); + assert(block_rep->data); r->data_block.SwapAndReset(*(block_rep->data)); block_rep->contents = *(block_rep->data);