This is an archive of the discontinued LLVM Phabricator instance.

[llvm-cxxfilt] Replace isalnum with isAlnum from StringExtras
ClosedPublic

Authored by tmiasko on Oct 1 2021, 11:01 PM.

Details

Summary

D104366 introduced a new llvm-cxxfilt test with non-ASCII characters,
which caused a failure on llvm-clang-x86_64-expensive-checks-win
builder, with a stack trace suggesting issue in a call to isalnum.

The argument to isalnum should be either EOF or a value that is
representable in the type unsigned char. The llvm-cxxfilt does not
perform a cast from char to unsigned char before the call, so the
value might be out of valid range.

Replace the call to isalnum with isAlnum from StringExtras, which takes
a char as the argument. This also makes the check independent of the
current locale.

Diff Detail

Event Timeline

tmiasko created this revision.Oct 1 2021, 11:01 PM
tmiasko requested review of this revision.Oct 1 2021, 11:01 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 1 2021, 11:01 PM

Generally if a patch requires review, that's probably too long a turnaround to leave something broken on a buildbot - probably worth reverting the other patch, maybe including this change in that patch - or possibly committing this separately if possible especially if it can be tested independently.

This revision was not accepted when it landed; it landed in state Needs Review.Oct 1 2021, 11:57 PM
This revision was automatically updated to reflect the committed changes.
Orlando added a subscriber: Orlando.Oct 4 2021, 9:41 AM

Hi, the change to llvm/test/tools/llvm-cxxfilt/delimiters.test caused it to fail when run from cmd.exe. I've put up D111072 for review as a work around.