Commit 934b3c4f authored by Philip Pronin's avatar Philip Pronin Committed by Dave Watson

fix IOBuf self move-assignment

Summary: Properly handle `this == &other` case.

Test Plan: fbconfig -r folly/test && fbmake runtests_opt -j32

Reviewed By: simpkins@fb.com

FB internal diff: D1314916
parent 2aad5a96
......@@ -365,6 +365,10 @@ IOBuf::~IOBuf() {
}
IOBuf& IOBuf::operator=(IOBuf&& other) noexcept {
if (this == &other) {
return *this;
}
// If we are part of a chain, delete the rest of the chain.
while (next_ != this) {
// Since unlink() returns unique_ptr() and we don't store it,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment