[PATCH] D32218: X86AsmParser.cpp asserts: OperandStack.size() > 1 && "Too few operands."

Andrew V. Tischenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 25 06:53:22 PDT 2017


avt77 updated this revision to Diff 96545.
avt77 added a reviewer: mcrosier.
avt77 added a comment.

I simply commented the check becuase it hides the case of identificator. There are no regression failed tests that's why I hope it's acceptable.

mcrosier, it seems you are "blame" in this code. Could you review it?


https://reviews.llvm.org/D32218

Files:
  lib/Target/X86/AsmParser/X86AsmParser.cpp
  test/MC/X86/pr22004.s


Index: test/MC/X86/pr22004.s
===================================================================
--- test/MC/X86/pr22004.s
+++ test/MC/X86/pr22004.s
@@ -0,0 +1,3 @@
+// RUN: llvm-mc -triple x86_64-unknown-unknown -x86-asm-syntax=intel %s
+
+lea rax, qword ptr [rip + .L.str]
Index: lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -1332,16 +1332,17 @@
   while (!Done) {
     bool UpdateLocLex = true;
 
+    AsmToken::TokenKind TK = getLexer().getKind();
     // The period in the dot operator (e.g., [ebx].foo.bar) is parsed as an
     // identifier.  Don't try an parse it as a register.
-    if (PrevTK != AsmToken::Error && Tok.getString().startswith("."))
-      break;
+//    if (PrevTK != AsmToken::Error && Tok.getString().startswith(".") &&
+//        TK != AsmToken::Identifier)
+//      break;
 
     // If we're parsing an immediate expression, we don't expect a '['.
     if (SM.getStopOnLBrac() && getLexer().getKind() == AsmToken::LBrac)
       break;
 
-    AsmToken::TokenKind TK = getLexer().getKind();
     switch (TK) {
     default: {
       if (SM.isValidEndState()) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32218.96545.patch
Type: text/x-patch
Size: 1248 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170425/b570d1f3/attachment.bin>


More information about the llvm-commits mailing list