This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

Re: [Patch] Fix (similarly) libstdc++/9178 and 11305


Martin Sebor wrote:

+          int __ext_multiplier = _M_codecvt->encoding();
+          if (__ext_multiplier == -1 || __ext_multiplier == 0)
+        __ext_multiplier = _M_codecvt->max_length();

FWIW, this doesn't seem quite right when encoding() returns -1.
The number of external bytes required to produce a single internal
character could be greater than max_length() (e.g., a whole bunch
of unshift sequences, one after another, followed by a character).

Thanks for your feedback.
Yes, we know that (see the comment in showmanyc()), but in fact enconding() == -1 is not really supported, right now, here and elsewhere. I have only copied, as a placeholder, the same 'if' already present in overflow.


Thanks again,
Paolo.


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