Skip to content

Commit

Permalink
Avoid errors after missing INCLUDE with -MG (#1627)
Browse files Browse the repository at this point in the history
  • Loading branch information
Rangi42 authored Jan 25, 2025
1 parent 8905288 commit 20c1825
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/asm/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,13 +385,15 @@ int main(int argc, char *argv[]) {
if (yy::parser parser; parser.parse() != 0 && nbErrors == 0)
nbErrors = 1;

sect_CheckUnionClosed();
sect_CheckLoadClosed();
sect_CheckSizes();

charmap_CheckStack();
opt_CheckStack();
sect_CheckStack();
if (!failedOnMissingInclude) {
sect_CheckUnionClosed();
sect_CheckLoadClosed();
sect_CheckSizes();

charmap_CheckStack();
opt_CheckStack();
sect_CheckStack();
}

if (nbErrors != 0)
errx("Assembly aborted (%u error%s)!", nbErrors, nbErrors == 1 ? "" : "s");
Expand Down
10 changes: 10 additions & 0 deletions test/asm/errors-after-missing-include.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
PUSHC
PUSHO
PUSHS
SECTION "test", WRAM0
UNION
INCLUDE "does not exist"
ENDU
POPS
POPO
POPC
1 change: 1 addition & 0 deletions test/asm/errors-after-missing-include.flags
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Weverything -M /dev/null -MG

0 comments on commit 20c1825

Please sign in to comment.