diff options
| author | Simon Atanasyan <simon@atanasyan.com> | 2018-05-29 09:51:22 +0000 |
|---|---|---|
| committer | Simon Atanasyan <simon@atanasyan.com> | 2018-05-29 09:51:22 +0000 |
| commit | 3535cb11309938511cc23c26e348e3deba6f0d53 (patch) | |
| tree | fa47b39419390baf0800eead38c9d7aa065c0423 /llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | |
| parent | 0bd19ead89e40aab47d04f8e56e9affa6ed29916 (diff) | |
| download | bcm5719-llvm-3535cb11309938511cc23c26e348e3deba6f0d53.tar.gz bcm5719-llvm-3535cb11309938511cc23c26e348e3deba6f0d53.zip | |
[mips] Stop parsing a .set assignment if the first argument is not an identifier
Before this fix the following code triggers two error messages. The
second one is at least useless:
test.s:1:9: error: expected identifier after .set
.set 123, $a0
^
test-set.s:1:9: error: unexpected token, expected comma
.set 123, $a0
^
llvm-svn: 333402
Diffstat (limited to 'llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp')
| -rw-r--r-- | llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp index 19261901d06..312f071676d 100644 --- a/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp +++ b/llvm/lib/Target/Mips/AsmParser/MipsAsmParser.cpp @@ -6843,7 +6843,7 @@ bool MipsAsmParser::parseSetAssignment() { MCAsmParser &Parser = getParser(); if (Parser.parseIdentifier(Name)) - reportParseError("expected identifier after .set"); + return reportParseError("expected identifier after .set"); if (getLexer().isNot(AsmToken::Comma)) return reportParseError("unexpected token, expected comma"); @@ -7330,8 +7330,7 @@ bool MipsAsmParser::parseDirectiveSet() { return parseSetNoGINVDirective(); } else { // It is just an identifier, look for an assignment. - parseSetAssignment(); - return false; + return parseSetAssignment(); } return true; |

