mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-24 08:24:33 +00:00
Generalize a previous change, fixing PR8855 - an valid large immediate
rejected by the mc assembler. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122557 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -184,12 +184,12 @@ AsmToken AsmLexer::LexDigit() {
|
||||
|
||||
long long Value;
|
||||
if (Result.getAsInteger(10, Value)) {
|
||||
// We have to handle minint_as_a_positive_value specially, because
|
||||
// - minint_as_a_positive_value = minint and it is valid.
|
||||
if (Result == "9223372036854775808")
|
||||
Value = -9223372036854775808ULL;
|
||||
else
|
||||
return ReturnError(TokStart, "Invalid decimal number");
|
||||
// Allow positive values that are too large to fit into a signed 64-bit
|
||||
// integer, but that do fit in an unsigned one, we just convert them over.
|
||||
unsigned long long UValue;
|
||||
if (Result.getAsInteger(10, UValue))
|
||||
return ReturnError(TokStart, "invalid decimal number");
|
||||
Value = (long long)UValue;
|
||||
}
|
||||
|
||||
// The darwin/x86 (and x86-64) assembler accepts and ignores ULL and LL
|
||||
|
Reference in New Issue
Block a user