mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-02 07:11:49 +00:00
MC: Diagnose an unexpected token in COFF .section instead of asserting
This can easily arise when trying to assemble and ELF style .section directive for a COFF object file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@215373 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a7f0941b83
commit
b81e6cf6c5
@ -364,6 +364,10 @@ bool COFFAsmParser::ParseDirectiveSection(StringRef, SMLoc) {
|
||||
|
||||
Flags |= COFF::IMAGE_SCN_LNK_COMDAT;
|
||||
|
||||
if (!getLexer().is(AsmToken::Identifier))
|
||||
return TokError("expected comdat type such as 'discard' or 'largest' "
|
||||
"after protection bits");
|
||||
|
||||
if (parseCOMDATType(Type))
|
||||
return true;
|
||||
|
||||
|
@ -6,3 +6,6 @@
|
||||
|
||||
// CHECK: error: conflicting section flags 'b' and 'd'
|
||||
.section s_bd,"bd"; .long 1
|
||||
|
||||
// CHECK: error: expected comdat type such as 'discard' or 'largest' after protection bits
|
||||
.section .stack, "w", @nobits
|
||||
|
Loading…
Reference in New Issue
Block a user