MC/AsmParser: Handle a missed case of floating literals in the lexer.
authorDaniel Dunbar <daniel@zuster.org>
Fri, 24 Sep 2010 17:10:26 +0000 (17:10 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 24 Sep 2010 17:10:26 +0000 (17:10 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114733 91177308-0d34-0410-b5e6-96231b3b80d8

lib/MC/MCParser/AsmLexer.cpp
test/MC/AsmParser/floating-literals.s

index 59da3817c18bd5d6b1097d1562bb4278fedcf42a..1a71d2437df43bd48bb3e4706a9e9ebb61b340bf 100644 (file)
@@ -145,7 +145,7 @@ static void SkipIgnoredIntegerSuffix(const char *&CurPtr) {
 ///   Decimal integer: [1-9][0-9]*
 AsmToken AsmLexer::LexDigit() {
   // Decimal integer: [1-9][0-9]*
-  if (CurPtr[-1] != '0') {
+  if (CurPtr[-1] != '0' || CurPtr[0] == '.') {
     while (isdigit(*CurPtr))
       ++CurPtr;
 
index 44f8a5ab0a7fd4d1707009c33a0b9576974f7382..dbeb81fb9eecc4921f31fef4c97a8ca7137d01dc 100644 (file)
@@ -10,3 +10,6 @@
 # CHECK: .quad 4597526701198935065
 # CHECK: .quad -4600933674317040845
 .double 5, .232, -11.1
+
+# CHECK: .quad  0
+.double 0.0