[PATCH] D99889: [AsmParser][ms][X86] Fix possible misbehaviour in parsing of special tokens at start of string.

Anirudh Prasad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 19 11:45:04 PDT 2021


anirudhp added inline comments.


================
Comment at: llvm/lib/MC/MCParser/AsmLexer.cpp:774
+    if (isalpha(CurChar) || CurChar == '_' || CurChar == '.' ||
+        (MAI.doesAllowQuestionAtStartOfIdentifier() && CurChar == '?'))
+      return LexIdentifier();
----------------
epastor wrote:
> If we're handling @ in its own case below, shouldn't we also handle ? there as well?
> 
> Otherwise, looks good to me... and it's possible we can improve MASM-style lexing using this too.
> shouldn't we also handle "?" there as well?

I don't believe so because "?" was never handled separately to begin with. It is already lexed "as part" of an Identifier, we just add on the additional logic to accept "?" at the start of the string as an Identifier as well.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99889/new/

https://reviews.llvm.org/D99889



More information about the llvm-commits mailing list