mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-03 19:15:30 +00:00
[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
This commit is contained in:
parent
d0c8980196
commit
b76e6a781e
@ -973,6 +973,9 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
|
||||
|
||||
// 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.
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user