Index: lib/MC/MCParser/AsmLexer.cpp =================================================================== --- lib/MC/MCParser/AsmLexer.cpp +++ lib/MC/MCParser/AsmLexer.cpp @@ -68,7 +68,7 @@ /// consumed. AsmToken AsmLexer::LexFloatLiteral() { // Skip the fractional digit sequence. - while (isdigit(*CurPtr)) + while (isdigit(static_cast(*CurPtr))) ++CurPtr; // Check for exponent; we intentionally accept a slighlty wider set of @@ -78,7 +78,7 @@ ++CurPtr; if (*CurPtr == '-' || *CurPtr == '+') ++CurPtr; - while (isdigit(*CurPtr)) + while (isdigit(static_cast(*CurPtr))) ++CurPtr; } @@ -102,7 +102,7 @@ ++CurPtr; const char *FracStart = CurPtr; - while (isxdigit(*CurPtr)) + while (isxdigit(static_cast(*CurPtr))) ++CurPtr; NoFracDigits = CurPtr == FracStart; @@ -123,7 +123,7 @@ // N.b. exponent digits are *not* hex const char *ExpStart = CurPtr; - while (isdigit(*CurPtr)) + while (isdigit(static_cast(*CurPtr))) ++CurPtr; if (CurPtr == ExpStart) @@ -135,15 +135,15 @@ /// LexIdentifier: [a-zA-Z_.][a-zA-Z0-9_$.@?]* static bool IsIdentifierChar(char c, bool AllowAt) { - return isalnum(c) || c == '_' || c == '$' || c == '.' || - (c == '@' && AllowAt) || c == '?'; + return isalnum(static_cast(c)) || c == '_' || c == '$' || + c == '.' || (c == '@' && AllowAt) || c == '?'; } AsmToken AsmLexer::LexIdentifier() { // Check for floating point literals. - if (CurPtr[-1] == '.' && isdigit(*CurPtr)) { + if (CurPtr[-1] == '.' && isdigit(static_cast(*CurPtr))) { // Disambiguate a .1243foo identifier from a floating literal. - while (isdigit(*CurPtr)) + while (isdigit(static_cast(*CurPtr))) ++CurPtr; if (*CurPtr == 'e' || *CurPtr == 'E' || !IsIdentifierChar(*CurPtr, AllowAtInIdentifier)) @@ -244,9 +244,9 @@ const char *FirstHex = nullptr; const char *LookAhead = CurPtr; while (true) { - if (isdigit(*LookAhead)) { + if (isdigit(static_cast(*LookAhead))) { ++LookAhead; - } else if (isxdigit(*LookAhead)) { + } else if (isxdigit(static_cast(*LookAhead))) { if (!FirstHex) FirstHex = LookAhead; ++LookAhead; @@ -282,7 +282,7 @@ const char *FirstNonBinary = (CurPtr[-1] != '0' && CurPtr[-1] != '1') ? CurPtr - 1 : nullptr; const char *OldCurPtr = CurPtr; - while (isxdigit(*CurPtr)) { + while (isxdigit(static_cast(*CurPtr))) { if (*CurPtr != '0' && *CurPtr != '1' && !FirstNonBinary) FirstNonBinary = CurPtr; ++CurPtr; @@ -346,7 +346,7 @@ if (!IsParsingMSInlineAsm && ((*CurPtr == 'b') || (*CurPtr == 'B'))) { ++CurPtr; // See if we actually have "0b" as part of something like "jmp 0b\n" - if (!isdigit(CurPtr[0])) { + if (!isdigit(static_cast(CurPtr[0]))) { --CurPtr; StringRef Result(TokStart, CurPtr - TokStart); return AsmToken(AsmToken::Integer, Result, 0); @@ -375,7 +375,7 @@ if ((*CurPtr == 'x') || (*CurPtr == 'X')) { ++CurPtr; const char *NumStart = CurPtr; - while (isxdigit(CurPtr[0])) + while (isxdigit(static_cast(CurPtr[0]))) ++CurPtr; // "0x.0p0" is valid, and "0x0p0" (but not "0xp0" for example, which will be Index: test/MC/AsmParser/non-english-characters.s =================================================================== --- test/MC/AsmParser/non-english-characters.s +++ test/MC/AsmParser/non-english-characters.s @@ -0,0 +1,11 @@ +# RUN: llvm-mc -triple i386-linux-gnu < %s > %t +# 0bム +# 0xム +# .ム4 +# .Xム +# .1ム +# .1eム +# 0x.ム +# 0x0pム +.intel_syntax +# 1ム