llvm.org GIT mirror llvm / b76e6a7
[AsmParser] Diagnose empty symbol for .set directive Summary: Diagnose empty symbol to avoid hitting assertion in MCContext::getOrCreateSymbol Reviewers: eli.friedman, rengolin Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D26728 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@288390 91177308-0d34-0410-b5e6-96231b3b80d8 Weiming Zhao 3 years ago
2 changed file(s) with 5 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
972972
973973 // This is a symbol reference.
974974 StringRef SymbolName = Identifier;
975 if (SymbolName.empty())
976 return true;
977
975978 MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
976979
977980 // Lookup the symbol variant if used.
44 .set a, 1
55 .equ a, 2
66 .equiv a, 3
7 .set b, ""
78 // CHECK: error: redefinition of 'a'
8
9 // CHECK: error: missing expression in '.set' directive