Fix clang-analyzer false-positive on ldb_cmd.cc

Summary:
clang-analyzer complaint about db_ being nullptr, but it couldn't be because it checks exec_stats before proceed. Add an assert to get around the false-positive.

Test Plan
`make analyze`
Closes https://github.com/facebook/rocksdb/pull/3236

Differential Revision: D6505417

Pulled By: yiwu-arbug

fbshipit-source-id: e5b65764ea994dd9e4bab3e697b97dc70dc22cab
This commit is contained in:
Yi Wu 2017-12-06 22:54:11 -08:00 committed by Facebook Github Bot
parent bbef8c3884
commit e1c569c324

View File

@ -1689,6 +1689,7 @@ void ReduceDBLevelsCommand::DoCommand() {
if (exec_state_.IsFailed()) {
return;
}
assert(db_ != nullptr);
// Compact the whole DB to put all files to the highest level.
fprintf(stdout, "Compacting the db...\n");
db_->CompactRange(CompactRangeOptions(), GetCfHandle(), nullptr, nullptr);