diff options
-rw-r--r-- | lib/MC/MCParser/AsmLexer.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/MC/MCParser/AsmLexer.cpp b/lib/MC/MCParser/AsmLexer.cpp index a7de64f32e..530e94e8d3 100644 --- a/lib/MC/MCParser/AsmLexer.cpp +++ b/lib/MC/MCParser/AsmLexer.cpp @@ -285,9 +285,11 @@ AsmToken AsmLexer::LexDigit() { // Either octal or hexidecimal. long long Value; unsigned Radix = doLookAhead(CurPtr, 8); + bool isHex = Radix == 16; StringRef Result(TokStart, CurPtr - TokStart); if (Result.getAsInteger(Radix, Value)) - return ReturnError(TokStart, "invalid octal number"); + return ReturnError(TokStart, !isHex ? "invalid octal number" : + "invalid hexdecimal number"); // Consume the [hH]. if (Radix == 16) |