diff --git a/lib/MC/MCParser/AsmLexer.cpp b/lib/MC/MCParser/AsmLexer.cpp index 7ca1cccc98c..867cb208cec 100644 --- a/lib/MC/MCParser/AsmLexer.cpp +++ b/lib/MC/MCParser/AsmLexer.cpp @@ -119,7 +119,7 @@ AsmToken AsmLexer::LexSlash() { switch (*CurPtr) { case '*': break; // C style comment. case '/': return ++CurPtr, LexLineComment(); - default: return AsmToken(AsmToken::Slash, StringRef(CurPtr, 1)); + default: return AsmToken(AsmToken::Slash, StringRef(CurPtr-1, 1)); } // C Style comment. diff --git a/test/MC/AsmParser/exprs.s b/test/MC/AsmParser/exprs.s index 4e514032b6c..1cc96a3f418 100644 --- a/test/MC/AsmParser/exprs.s +++ b/test/MC/AsmParser/exprs.s @@ -19,9 +19,8 @@ k: check_expr +1, 1 check_expr 1 + 2, 3 check_expr 1 & 3, 1 - // FIXME: There is a bug here in macro expansion. - .byte 4 / 2 - .byte 4 / -2 + check_expr 4 / 2, 2 + check_expr 4 / -2, -2 check_expr 1 == 1, 1 check_expr 1 == 0, 0 check_expr 1 > 0, 1