[PATCH] D104869: [AsmParser][SystemZ][z/OS] Fix hanging scenario in HLASMAsmParser class

Anirudh Prasad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 28 09:47:20 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2dca0b5a1ce4: [AsmParser][SystemZ][z/OS] Fix hanging scenario in HLASMAsmParser class (authored by anirudhp).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D104869

Files:
  llvm/lib/MC/MCParser/AsmParser.cpp


Index: llvm/lib/MC/MCParser/AsmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/AsmParser.cpp
+++ llvm/lib/MC/MCParser/AsmParser.cpp
@@ -6302,8 +6302,12 @@
   if (ShouldParseAsHLASMLabel) {
     // If there were any errors while handling and emitting the label,
     // early return.
-    if (parseAsHLASMLabel(Info, SI))
+    if (parseAsHLASMLabel(Info, SI)) {
+      // If we know we've failed in parsing, simply eat until end of the
+      // statement. This ensures that we don't process any other statements.
+      eatToEndOfStatement();
       return true;
+    }
   }
 
   return parseAsMachineInstruction(Info, SI);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D104869.354939.patch
Type: text/x-patch
Size: 680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210628/70818ca6/attachment.bin>


More information about the llvm-commits mailing list