summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCParser
diff options
context:
space:
mode:
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-10-08 10:28:11 +0000
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>2018-10-08 10:28:11 +0000
commit627d1469987a38cc9efcfbc63556b0b1342f4373 (patch)
treef1177b9e3e9c6a5ecb13c041183de13ffea56eb0 /llvm/lib/MC/MCParser
parent6f36cd4d76c65796b695df1a34c501ac3aa05229 (diff)
downloadbcm5719-llvm-627d1469987a38cc9efcfbc63556b0b1342f4373.tar.gz
bcm5719-llvm-627d1469987a38cc9efcfbc63556b0b1342f4373.zip
[AsmParser] Return an error in the case of empty symbol ref in an expression
The following instruction: > str q28, [x0, #1*6*4*@] contains a @ which is parsed as an empty symbol. The parser returns true but has no error, so the assembler continues by ignoring the instruction. Differential Revision: https://reviews.llvm.org/D52645 llvm-svn: 343961
Diffstat (limited to 'llvm/lib/MC/MCParser')
-rw-r--r--llvm/lib/MC/MCParser/AsmParser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCParser/AsmParser.cpp b/llvm/lib/MC/MCParser/AsmParser.cpp
index eb76dd07088..6eb7fd0d0b6 100644
--- a/llvm/lib/MC/MCParser/AsmParser.cpp
+++ b/llvm/lib/MC/MCParser/AsmParser.cpp
@@ -1103,7 +1103,7 @@ bool AsmParser::parsePrimaryExpr(const MCExpr *&Res, SMLoc &EndLoc) {
// This is a symbol reference.
StringRef SymbolName = Identifier;
if (SymbolName.empty())
- return true;
+ return Error(getLexer().getLoc(), "expected a symbol reference");
MCSymbolRefExpr::VariantKind Variant = MCSymbolRefExpr::VK_None;
OpenPOWER on IntegriCloud