diff options
author | Chris Lattner <sabre@nondot.org> | 2010-12-25 21:36:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-12-25 21:36:35 +0000 |
commit | 03a102bff3bf1dbb37cac3f4e201e4b28b46a2fe (patch) | |
tree | 6a3eeffab6d2b2ee2dc27721734ce9db58be550a /llvm/lib/MC/MCParser/AsmLexer.cpp | |
parent | d729d0dcdbf528a229802198caacd6c4e5e0535e (diff) | |
download | llvm-03a102bff3bf1dbb37cac3f4e201e4b28b46a2fe.zip llvm-03a102bff3bf1dbb37cac3f4e201e4b28b46a2fe.tar.gz llvm-03a102bff3bf1dbb37cac3f4e201e4b28b46a2fe.tar.bz2 |
Generalize a previous change, fixing PR8855 - an valid large immediate
rejected by the mc assembler.
llvm-svn: 122557
Diffstat (limited to 'llvm/lib/MC/MCParser/AsmLexer.cpp')
-rw-r--r-- | llvm/lib/MC/MCParser/AsmLexer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCParser/AsmLexer.cpp b/llvm/lib/MC/MCParser/AsmLexer.cpp index e474a15..5c617bc 100644 --- a/llvm/lib/MC/MCParser/AsmLexer.cpp +++ b/llvm/lib/MC/MCParser/AsmLexer.cpp @@ -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 |