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 #7 from Paolo Carlini <paolo.carlini at oracle dot com> 2012-08-29 15:13:57 UTC ---
Thus, I guess the right thing to do is sort-of the other way around of what I
was thinking: change _M_disjunct in such a way that when the destination is the
empty rep it always returns true, thus we first allocate memory for the
destination and then copy the '\0' to it and everything is fine (nothing bad
can happen to the source in this special case because the empty rep source
isn't in dynamically allocated memory, thus isn't deallocated, it stays in
memory forever).


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