Do not perform any sanity checks for bad section types

Otherwise, the arrays get overflowed
This commit is contained in:
ISSOtm
2022-07-08 19:22:12 +02:00
committed by Eldred Habert
parent acb33777c6
commit d243e50390

View File

@@ -220,8 +220,11 @@ static void doSanityChecks(struct Section *section, void *ptr)
/* Sanity check the section's type */
if (section->type < 0 || section->type >= SECTTYPE_INVALID)
if (section->type < 0 || section->type >= SECTTYPE_INVALID) {
fail("Section \"%s\" has an invalid type.", section->name);
return;
}
if (is32kMode && section->type == SECTTYPE_ROMX) {
if (section->isBankFixed && section->bank != 1)
fail("%s: ROMX sections must be in bank 1 (if any) with option -t",