From 550a1df72c20cab9679626b07187a00d84cded31 Mon Sep 17 00:00:00 2001 From: Maysam Yabandeh Date: Tue, 6 Jun 2017 12:50:56 -0700 Subject: [PATCH] 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 --- env/io_posix.cc | 1 + utilities/blob_db/blob_db_impl.cc | 1 + 2 files changed, 2 insertions(+) diff --git a/env/io_posix.cc b/env/io_posix.cc index 26557fc61..707639039 100644 --- a/env/io_posix.cc +++ b/env/io_posix.cc @@ -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; diff --git a/utilities/blob_db/blob_db_impl.cc b/utilities/blob_db/blob_db_impl.cc index 984be3152..a3122f5c5 100644 --- a/utilities/blob_db/blob_db_impl.cc +++ b/utilities/blob_db/blob_db_impl.cc @@ -1200,6 +1200,7 @@ std::vector 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);