Make some INCBIN errors non-fatal

This commit is contained in:
ISSOtm
2021-03-10 00:52:40 +01:00
committed by Eldred Habert
parent f11241c2ae
commit 714d39c86f
3 changed files with 15 additions and 8 deletions

View File

@@ -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 {

View File

@@ -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)!

View File

@@ -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)!