This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libstdc++/54392] [4.6/4.7/4.8 Regression] std::string::assign() fails to update length


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54392

--- Comment #11 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-29 16:20:43 UTC ---
I'm sorry, you are right - it's been a while since the last time I looked into
this code - going that way of the conditional is Ok, because the memory
corresponding to the source (which coincide with that of the destination
string) is deallocated only after all the chars are copied. Good. Thus it means
that in general, we want, again to change _M_disjoint not to check that the
destination is the empty rep, but precisely for this more general case, that
is, the source begin is the same as the this->begin() beginning, and the size
is this->size() + 1 and return true. We have to add an overload, because the
current one doesn't take the size of the source. I think this is it.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]