Bug 2665120: flex_string fatal error assigning big string to small
git-svn-id: svn://svn.code.sf.net/p/loki-lib/code/trunk@1007 7ec92016-0320-0410-acc4-a06ded1c099a
This commit is contained in:
parent
0174e55298
commit
a251ebcc12
1 changed files with 1 additions and 9 deletions
|
@ -220,15 +220,7 @@ public:
|
|||
new(this) SmallStringOpt(rhs);
|
||||
} else {
|
||||
SmallStringOpt copy(rhs);
|
||||
if (Small()) {
|
||||
// no need to swap, just destructively read copy into this
|
||||
// ugly but efficient again
|
||||
memcpy(this, ©, sizeof(*this));
|
||||
copy.buf_[maxSmallString] = maxSmallString; // clear the copy
|
||||
} else {
|
||||
// Use the swap trick
|
||||
copy.swap(*this);
|
||||
}
|
||||
copy.swap(*this);
|
||||
}
|
||||
}
|
||||
return *this;
|
||||
|
|
Loading…
Reference in a new issue