Incorporate Daniel's suggestion and use !isdigit(CurPtr[0]) and not
authorKevin Enderby <enderby@apple.com>
Tue, 18 May 2010 18:09:20 +0000 (18:09 +0000)
committerKevin Enderby <enderby@apple.com>
Tue, 18 May 2010 18:09:20 +0000 (18:09 +0000)
CurPtr[0] == '\n' when testing the character after a "0b" when looking
to see if it part of a something like "jmp 0b".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104039 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/AsmLexer.cpp

index 32b446fce776a66f403b336fc02067ab59e43ee4..7c098a6e6c67d46f991f0a5f61cc8a0df737c03e 100644 (file)
@@ -154,7 +154,7 @@ AsmToken AsmLexer::LexDigit() {
   if (*CurPtr == 'b') {
     ++CurPtr;
     // See if we actually have "0b" as part of something like "jmp 0b\n"
-    if (CurPtr[0] == '\n') {
+    if (!isdigit(CurPtr[0])) {
       --CurPtr;
       StringRef Result(TokStart, CurPtr - TokStart);
       return AsmToken(AsmToken::Integer, Result, 0);