mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-29 19:28:19 +00:00
[Asm] Don't list '@<type>' in diag when '@' is a comment
This fixes https://bugs.llvm.org//show_bug.cgi?id=31280 Differential revision: https://reviews.llvm.org/D31026 llvm-svn: 298067
This commit is contained in:
parent
b7f0f45ffe
commit
8761e9bb43
@ -391,8 +391,12 @@ bool ELFAsmParser::maybeParseSectionType(StringRef &TypeName) {
|
||||
return false;
|
||||
Lex();
|
||||
if (L.isNot(AsmToken::At) && L.isNot(AsmToken::Percent) &&
|
||||
L.isNot(AsmToken::String))
|
||||
return TokError("expected '@<type>', '%<type>' or \"<type>\"");
|
||||
L.isNot(AsmToken::String)) {
|
||||
if (L.getAllowAtInIdentifier())
|
||||
return TokError("expected '@<type>', '%<type>' or \"<type>\"");
|
||||
else
|
||||
return TokError("expected '%<type>' or \"<type>\"");
|
||||
}
|
||||
if (!L.is(AsmToken::String))
|
||||
Lex();
|
||||
if (L.is(AsmToken::Integer)) {
|
||||
|
@ -7,3 +7,7 @@
|
||||
// CHECK: .type TYPE #32
|
||||
// CHECK: ^
|
||||
|
||||
// For ARM, the comment character is '@', so we don't list '@<type>' as a
|
||||
// valid option.
|
||||
.section "foo", "a", @progbits
|
||||
// CHECK: error: expected '%<type>' or "<type>"
|
||||
|
Loading…
Reference in New Issue
Block a user