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);
|
new(this) SmallStringOpt(rhs);
|
||||||
} else {
|
} else {
|
||||||
SmallStringOpt copy(rhs);
|
SmallStringOpt copy(rhs);
|
||||||
if (Small()) {
|
copy.swap(*this);
|
||||||
// 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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
|
|
Loading…
Add table
Reference in a new issue