summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
authorMarshall Clow <mclow.lists@gmail.com>2014-09-16 18:57:52 +0000
committerMarshall Clow <mclow.lists@gmail.com>2014-09-16 18:57:52 +0000
commitd1b5078579c5123746feaa2dabcd285aed3b27ab (patch)
tree5d3ecb52528125cd7009aeb8d8b1584d0bc33f71 /libcxx/include
parent98c9accacec15eeb284f1ae62cbb81e1f3a411ac (diff)
downloadbcm5719-llvm-d1b5078579c5123746feaa2dabcd285aed3b27ab.tar.gz
bcm5719-llvm-d1b5078579c5123746feaa2dabcd285aed3b27ab.zip
Fix a bug in the move-assigment operator for basic_stringbuf. Thanks to Johnathan Wakeley for the bug report
llvm-svn: 217894
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/sstream5
1 files changed, 5 insertions, 0 deletions
diff --git a/libcxx/include/sstream b/libcxx/include/sstream
index f90d4464a40..27ae78f9d45 100644
--- a/libcxx/include/sstream
+++ b/libcxx/include/sstream
@@ -325,11 +325,16 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::operator=(basic_stringbuf&& __rhs)
__p = const_cast<char_type*>(__str_.data());
if (__binp != -1)
this->setg(__p + __binp, __p + __ninp, __p + __einp);
+ else
+ this->setg(nullptr, nullptr, nullptr);
if (__bout != -1)
{
this->setp(__p + __bout, __p + __eout);
this->pbump(__nout);
}
+ else
+ this->setp(nullptr, nullptr);
+
__hm_ = __hm == -1 ? nullptr : __p + __hm;
__mode_ = __rhs.__mode_;
__p = const_cast<char_type*>(__rhs.__str_.data());
OpenPOWER on IntegriCloud