[PATCH] D60447: Check ID value is not empty before creation in Asm Parser

Brandon Jones via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 02:41:59 PDT 2019


BrandonTJones created this revision.
BrandonTJones added reviewers: andreadb, grosbach.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Repository:
  rL LLVM

https://reviews.llvm.org/D60447

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
@@ -1798,6 +1798,8 @@
                                        RewrittenLabel);
         IDVal = RewrittenLabel;
       }
+      if (IDVal.empty())
+        return Error(IDLoc, "expected a symbol reference.");
       Sym = getContext().getOrCreateSymbol(IDVal);
     } else
       Sym = Ctx.createDirectionalLocalSymbol(LocalLabelVal);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60447.194272.patch
Type: text/x-patch
Size: 523 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190409/331001a9/attachment-0001.bin>


More information about the llvm-commits mailing list