mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Add static cast to unsigned char whenever a character classification function is called with a signed char argument, in order to avoid assertions in Windows Debug configuration.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175006 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1622,7 +1622,8 @@ void AsmParser::DiagHandler(const SMDiagnostic &Diag, void *Context) {
|
||||
// we can't do that. AsmLexer.cpp should probably be changed to handle
|
||||
// '@' as a special case when needed.
|
||||
static bool isIdentifierChar(char c) {
|
||||
return isalnum(c) || c == '_' || c == '$' || c == '.';
|
||||
return isalnum(static_cast<unsigned char>(c)) || c == '_' || c == '$' ||
|
||||
c == '.';
|
||||
}
|
||||
|
||||
bool AsmParser::expandMacro(raw_svector_ostream &OS, StringRef Body,
|
||||
@@ -1646,7 +1647,8 @@ bool AsmParser::expandMacro(raw_svector_ostream &OS, StringRef Body,
|
||||
continue;
|
||||
|
||||
char Next = Body[Pos + 1];
|
||||
if (Next == '$' || Next == 'n' || isdigit(Next))
|
||||
if (Next == '$' || Next == 'n' ||
|
||||
isdigit(static_cast<unsigned char>(Next)))
|
||||
break;
|
||||
} else {
|
||||
// This macro has parameters, look for \foo, \bar, etc.
|
||||
@@ -3094,7 +3096,8 @@ void AsmParser::CheckForBadMacro(SMLoc DirectiveLoc, StringRef Name,
|
||||
if (Body[Pos] != '$' || Pos + 1 == End)
|
||||
continue;
|
||||
char Next = Body[Pos + 1];
|
||||
if (Next == '$' || Next == 'n' || isdigit(Next))
|
||||
if (Next == '$' || Next == 'n' ||
|
||||
isdigit(static_cast<unsigned char>(Next)))
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user