[PATCH] D26728: [AsmParser] Diagnose empty symbol for .set directive
Weiming Zhao via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 1 10:10:51 PST 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL288390: [AsmParser] Diagnose empty symbol for .set directive (authored by weimingz).
Changed prior to commit:
https://reviews.llvm.org/D26728?vs=78121&id=79941#toc
Repository:
rL LLVM
https://reviews.llvm.org/D26728
Files:
llvm/trunk/lib/MC/MCParser/AsmParser.cpp
llvm/trunk/test/MC/AsmParser/equ.s
Index: llvm/trunk/test/MC/AsmParser/equ.s
===================================================================
--- llvm/trunk/test/MC/AsmParser/equ.s
+++ llvm/trunk/test/MC/AsmParser/equ.s
@@ -5,5 +5,6 @@
.set a, 1
.equ a, 2
.equiv a, 3
+.set b, ""
// CHECK: error: redefinition of 'a'
-
+// CHECK: error: missing expression in '.set' directive
Index: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
===================================================================
--- llvm/trunk/lib/MC/MCParser/AsmParser.cpp
+++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp
@@ -973,6 +973,9 @@
// This is a symbol reference.
StringRef SymbolName = Identifier;
+ if (SymbolName.empty())
+ return true;
+
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
// Lookup the symbol variant if used.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26728.79941.patch
Type: text/x-patch
Size: 819 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161201/8349dfe8/attachment.bin>
More information about the llvm-commits
mailing list