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
main
Maysam Yabandeh 8 years ago committed by Facebook Github Bot
parent cc5f9339ee
commit 550a1df72c
  1. 1
      env/io_posix.cc
  2. 1
      utilities/blob_db/blob_db_impl.cc

1
env/io_posix.cc vendored

@ -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;

@ -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);

Loading…
Cancel
Save