Merge "adb: defuse CHECK on IOVector::append of an empty block."
This commit is contained in:
commit
5c58e092f3
1 changed files with 4 additions and 1 deletions
|
|
@ -216,7 +216,10 @@ struct IOVector {
|
||||||
// Add a nonempty block to the chain.
|
// Add a nonempty block to the chain.
|
||||||
// The end of the chain must be a complete block (i.e. end_offset_ == 0).
|
// The end of the chain must be a complete block (i.e. end_offset_ == 0).
|
||||||
void append(std::unique_ptr<const block_type> block) {
|
void append(std::unique_ptr<const block_type> block) {
|
||||||
CHECK_NE(0ULL, block->size());
|
if (block->size() == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
CHECK_EQ(0ULL, end_offset_);
|
CHECK_EQ(0ULL, end_offset_);
|
||||||
chain_length_ += block->size();
|
chain_length_ += block->size();
|
||||||
chain_.emplace_back(std::move(block));
|
chain_.emplace_back(std::move(block));
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue