diff options
author | Marshall Clow <mclow.lists@gmail.com> | 2019-06-04 15:18:46 +0000 |
---|---|---|
committer | Marshall Clow <mclow.lists@gmail.com> | 2019-06-04 15:18:46 +0000 |
commit | 605d62e9de00b9f95a00202f66dfb03fe52ca523 (patch) | |
tree | b427f908c72957d60947deba55899c3cbc4c4ee9 /libcxx/src | |
parent | 1e63dd0b44998721fefae9f690882af927ca3c2a (diff) | |
download | bcm5719-llvm-605d62e9de00b9f95a00202f66dfb03fe52ca523.tar.gz bcm5719-llvm-605d62e9de00b9f95a00202f66dfb03fe52ca523.zip |
No longer reject inputs when using a locale that has grouping information _and_ the input has no grouping characters at all. We continue to reject cases when the input has grouping characters in the wrong place. Fixes PR#28704
llvm-svn: 362508
Diffstat (limited to 'libcxx/src')
-rw-r--r-- | libcxx/src/locale.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp index 00eb574ec45..ca0a1c9b15f 100644 --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -4379,7 +4379,9 @@ void __check_grouping(const string& __grouping, unsigned* __g, unsigned* __g_end, ios_base::iostate& __err) { - if (__grouping.size() != 0) +// if the grouping pattern is empty _or_ there are no grouping bits, then do nothing +// we always have at least a single entry in [__g, __g_end); the end of the input sequence + if (__grouping.size() >= 0 && __g_end - __g > 1) { reverse(__g, __g_end); const char* __ig = __grouping.data(); |