From 7993d3455d9eef8173fe9d9fb24513989d72ce20 Mon Sep 17 00:00:00 2001 From: Ben10do Date: Thu, 2 Mar 2017 08:02:05 +0000 Subject: [PATCH] Update alignment error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ensure (in rgbasm) that the alignment value is between 1-16. Replaces the previous “alignment must not be negative” check. --- src/asm/output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/asm/output.c b/src/asm/output.c index e40f92c8..696c1a5b 100644 --- a/src/asm/output.c +++ b/src/asm/output.c @@ -631,8 +631,8 @@ out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank) void out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank) { - if (alignment < 0) { - yyerror("Alignment must not be negative."); + if (alignment < 1 || alignment > 16) { + yyerror("Alignment must be between 1-16 bits."); } out_SetCurrentSection(out_FindSection(pzName, secttype, -1, bank, 1 << alignment)); }