[PATCH] D119770: [libcxx] Fix the type in __estimate_column_width
Stefan Pintilie via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 14 13:02:15 PST 2022
stefanp created this revision.
stefanp added reviewers: nemanjai, hubert.reinterpretcast, daltenty, xingxue, Mordante.
stefanp requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.
It seems that we are using wchar_t in __estimate_column_width and assume that
it is a 32 bit type. However, on AIX 32 the size of wchar_t is only 16 bits.
Changed wchar_t to uint32_t since the variable is being passed to a function
that uses uint32_t anyway.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D119770
Files:
libcxx/include/__format/parser_std_format_spec.h
libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
Index: libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
===================================================================
--- libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
+++ libcxx/test/libcxx/utilities/format/format.string/format.string.std/std_format_spec_string_unicode.pass.cpp
@@ -9,9 +9,6 @@
// UNSUPPORTED: libcpp-no-concepts
// UNSUPPORTED: libcpp-has-no-incomplete-format
-// Fails for 32-bit builds on AIX.
-// UNSUPPORTED: LIBCXX-AIX-FIXME
-
// UTF-32 doesn't work properly
// XFAIL: windows
Index: libcxx/include/__format/parser_std_format_spec.h
===================================================================
--- libcxx/include/__format/parser_std_format_spec.h
+++ libcxx/include/__format/parser_std_format_spec.h
@@ -1271,7 +1271,7 @@
size_t __result = 0;
while (__first != __last) {
- wchar_t __c = *__first;
+ uint32_t __c = *__first;
__result += __column_width(__c);
if (__result > __maximum)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119770.408583.patch
Type: text/x-patch
Size: 1075 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220214/0a9dfc4c/attachment.bin>
More information about the llvm-commits
mailing list