Make fatalerror and yyerror consistent

There are two ways in which the assembly process can fail:

1. If there is a really big problem that compromises the whole process,
   the assembler has to stop right there and generate an error message.
   This happens with unterminated REPT loops, macros, etc.

2. If the problem isn't that big and the process can still continue,
   even though the final result is invalid, the assembler can try to
   continue and warn the user about all errors it finds in the code.

This patch clarifies the use of each function and replaces the function
used in two places by the correct one.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
This commit is contained in:
Antonio Niño Díaz
2017-04-29 15:02:57 +01:00
parent 4228e3e890
commit ff2321a8ce
3 changed files with 21 additions and 3 deletions

View File

@@ -535,7 +535,7 @@ yylex_ReadBracketedSymbol(char *dest, size_t index)
if (*pLexBuffer == '}')
pLexBuffer++;
else
yyerror("Missing }");
fatalerror("Missing }");
return length;
}
@@ -601,7 +601,7 @@ yylex_ReadQuotedString()
if (*pLexBuffer == '"')
pLexBuffer++;
else
yyerror("Unterminated string");
fatalerror("Unterminated string");
}
ULONG

View File

@@ -480,7 +480,8 @@ checksectionoverflow(ULONG delta_size)
/*
* This check is here to trap broken code that generates
* sections that are too big and to prevent the assembler from
* generating huge object files.
* generating huge object files or trying to allocate too much
* memory.
* The real check must be done at the linking stage.
*/
fatalerror("Section '%s' is too big (max size = 0x%X bytes).",