From 3992ce2502e46caf0105d093ee8f65651b2c6650 Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Thu, 25 Sep 2014 20:40:25 -0600 Subject: [PATCH] Separate errors that shouldn't have been combined in the first place. --- src/asm/output.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/asm/output.c b/src/asm/output.c index b1c254a6..24d88290 100644 --- a/src/asm/output.c +++ b/src/asm/output.c @@ -504,9 +504,12 @@ void checkcodesection(SLONG size) { checksection(); - if ((pCurrentSection->nType == SECT_ROM0 - || pCurrentSection->nType == SECT_ROMX) - && (pCurrentSection->nPC + size <= MAXSECTIONSIZE)) { + if (pCurrentSection->nType != SECT_ROM0 && + pCurrentSection->nType != SECT_ROMX) { + errx(1, "Section '%s' cannot contain code or data (not a " + "ROM0 or ROMX)", pCurrentSection->pzName); + } + if (pCurrentSection->nPC + size <= MAXSECTIONSIZE) { if (((pCurrentSection->nPC % SECTIONCHUNK) > ((pCurrentSection->nPC + size) % SECTIONCHUNK)) && (pCurrentSection->nType == SECT_ROM0 @@ -523,8 +526,7 @@ checkcodesection(SLONG size) } return; } else - fatalerror - ("Section can't contain initialized data or section limit exceeded"); + errx(1, "Section '%s' is too big", pCurrentSection->pzName); } /* * RGBAsm - OUTPUT.C - Outputs an objectfile