Fix clang errors by asserting the precondition

Summary:
USE_CLANG=1 make -j32 analyze
The two errors would disappear after the assertion.
Closes https://github.com/facebook/rocksdb/pull/2416

Differential Revision: D5193526

Pulled By: maysamyabandeh

fbshipit-source-id: 16a21f18f68023f862764dd3ab9e00ca60b0eefa
This commit is contained in:
Maysam Yabandeh 2017-06-06 12:50:56 -07:00 committed by Facebook Github Bot
parent cc5f9339ee
commit 550a1df72c
2 changed files with 2 additions and 0 deletions

1
env/io_posix.cc vendored
View File

@ -589,6 +589,7 @@ Status PosixMmapFile::Append(const Slice& data) {
}
size_t n = (left <= avail) ? left : avail;
assert(dst_);
memcpy(dst_, src, n);
dst_ += n;
src += n;

View File

@ -1200,6 +1200,7 @@ std::vector<Status> BlobDBImpl::MultiGet(
Status BlobDBImpl::CommonGet(const ColumnFamilyData* cfd, const Slice& key,
const std::string& index_entry, std::string* value,
SequenceNumber* sequence) {
assert(value);
Slice index_entry_slice(index_entry);
BlobHandle handle;
Status s = handle.DecodeFrom(&index_entry_slice);