This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Fix the type in __estimate_column_width
ClosedPublic

Authored by stefanp on Feb 14 2022, 1:02 PM.

Details

Summary

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.

Diff Detail

Event Timeline

stefanp requested review of this revision.Feb 14 2022, 1:02 PM
stefanp created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 14 2022, 1:02 PM
Herald added a reviewer: Restricted Project. · View Herald Transcript
stefanp added a reviewer: Restricted Project.Feb 14 2022, 1:03 PM

__utf32_character guards against usage of 16-bit wchar_t. The usage that gets broken by using wchar_t in the implementation is the char32_t case. There's no reason to tie the char32_t case to a UTF-32 wchar_t that I know of. The change LGTM.

Please wait for approval from the libc++ group.

Mordante accepted this revision as: Mordante.Feb 14 2022, 1:18 PM

Thanks for the fix. I wasn't aware of other 16-bit wchar_t platforms other than Windows.
(Still this should have been uint32_t in the first place, as I did in other places.)

daltenty accepted this revision as: daltenty.Feb 24 2022, 10:49 AM

Gentle ping: libc++

Quuxplusone accepted this revision.Feb 24 2022, 4:58 PM
This revision is now accepted and ready to land.Feb 24 2022, 4:58 PM
This revision was landed with ongoing or failed builds.Feb 25 2022, 7:05 AM
This revision was automatically updated to reflect the committed changes.

Hi, this patch had failed tests in CI shown already during review (this test, which used to be XFAILed for windows no longer fails there), and those CI failures now show up for all other patches. Please pay attention to the CI status of your patches before pushing them, even if you’ve got approval for the patch!