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:
parent
cc5f9339ee
commit
550a1df72c
1
env/io_posix.cc
vendored
1
env/io_posix.cc
vendored
@ -589,6 +589,7 @@ Status PosixMmapFile::Append(const Slice& data) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t n = (left <= avail) ? left : avail;
|
size_t n = (left <= avail) ? left : avail;
|
||||||
|
assert(dst_);
|
||||||
memcpy(dst_, src, n);
|
memcpy(dst_, src, n);
|
||||||
dst_ += n;
|
dst_ += n;
|
||||||
src += n;
|
src += n;
|
||||||
|
@ -1200,6 +1200,7 @@ std::vector<Status> BlobDBImpl::MultiGet(
|
|||||||
Status BlobDBImpl::CommonGet(const ColumnFamilyData* cfd, const Slice& key,
|
Status BlobDBImpl::CommonGet(const ColumnFamilyData* cfd, const Slice& key,
|
||||||
const std::string& index_entry, std::string* value,
|
const std::string& index_entry, std::string* value,
|
||||||
SequenceNumber* sequence) {
|
SequenceNumber* sequence) {
|
||||||
|
assert(value);
|
||||||
Slice index_entry_slice(index_entry);
|
Slice index_entry_slice(index_entry);
|
||||||
BlobHandle handle;
|
BlobHandle handle;
|
||||||
Status s = handle.DecodeFrom(&index_entry_slice);
|
Status s = handle.DecodeFrom(&index_entry_slice);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user