diff --git a/src/asm/section.c b/src/asm/section.c index 5a59b220..72557a5d 100644 --- a/src/asm/section.c +++ b/src/asm/section.c @@ -764,7 +764,8 @@ void out_BinaryFile(char const *s, int32_t startPos) oFailedOnMissingInclude = true; return; } - fatalerror("Error opening INCBIN file '%s': %s\n", s, strerror(errno)); + error("Error opening INCBIN file '%s': %s\n", s, strerror(errno)); + return; } int32_t fsize = -1; @@ -830,7 +831,8 @@ void out_BinaryFileSlice(char const *s, int32_t start_pos, int32_t length) oFailedOnMissingInclude = true; return; } - fatalerror("Error opening INCBIN file '%s': %s\n", s, strerror(errno)); + error("Error opening INCBIN file '%s': %s\n", s, strerror(errno)); + return; } checkcodesection(); @@ -846,8 +848,11 @@ void out_BinaryFileSlice(char const *s, int32_t start_pos, int32_t length) return; } - if ((start_pos + length) > fsize) - fatalerror("Specified range in INCBIN is out of bounds\n"); + if ((start_pos + length) > fsize) { + error("Specified range in INCBIN is out of bounds (%" PRIu32 " + %" PRIu32 + " > %" PRIu32 ")\n", start_pos, length, fsize); + return; + } fseek(f, start_pos, SEEK_SET); } else { diff --git a/test/asm/incbin-empty-bad.err b/test/asm/incbin-empty-bad.err index 0f812e8a..5c15becc 100644 --- a/test/asm/incbin-empty-bad.err +++ b/test/asm/incbin-empty-bad.err @@ -1,2 +1,3 @@ -FATAL: incbin-empty-bad.asm(3): - Specified range in INCBIN is out of bounds +ERROR: incbin-empty-bad.asm(3): + Specified range in INCBIN is out of bounds (0 + 1 > 0) +error: Assembly aborted (1 errors)! diff --git a/test/asm/incbin-end-bad.err b/test/asm/incbin-end-bad.err index 98856c73..3a21f2b6 100644 --- a/test/asm/incbin-end-bad.err +++ b/test/asm/incbin-end-bad.err @@ -1,2 +1,3 @@ -FATAL: incbin-end-bad.asm(3): - Specified range in INCBIN is out of bounds +ERROR: incbin-end-bad.asm(3): + Specified range in INCBIN is out of bounds (123 + 1 > 123) +error: Assembly aborted (1 errors)!