[PATCH] D57379: X86AsmParser: Do not process a non-existent token

Brandon Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 29 03:40:32 PST 2019


BrandonTJones created this revision.
BrandonTJones added reviewers: andreadb, grosbach.
Herald added subscribers: llvm-commits, hiraditya.

This error can only happen if an unfinished operation is at Eof.


Repository:
  rL LLVM

https://reviews.llvm.org/D57379

Files:
  llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp


Index: llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
===================================================================
--- llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
+++ llvm/lib/Target/X86/AsmParser/X86AsmParser.cpp
@@ -2981,6 +2981,11 @@
   case Match_MnemonicFail:
     break;
   }
+  if (Op.getToken().empty()) {
+    Error(IDLoc, "instruction must have size higher than 0", EmptyRange,
+          MatchingInlineAsm);
+    return true;
+  }
 
   // FIXME: Ideally, we would only attempt suffix matches for things which are
   // valid prefixes, and we could just infer the right unambiguous


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57379.184058.patch
Type: text/x-patch
Size: 602 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190129/0ad79644/attachment.bin>


More information about the llvm-commits mailing list