Update alignment error handling

Ensure (in rgbasm) that the alignment value is between 1-16. Replaces the previous “alignment must not be negative” check.
This commit is contained in:
Ben10do
2017-03-02 08:02:05 +00:00
parent 1ab93a194e
commit 7993d3455d

View File

@@ -631,8 +631,8 @@ out_NewAbsSection(char *pzName, ULONG secttype, SLONG org, SLONG bank)
void void
out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank) out_NewAlignedSection(char *pzName, ULONG secttype, SLONG alignment, SLONG bank)
{ {
if (alignment < 0) { if (alignment < 1 || alignment > 16) {
yyerror("Alignment must not be negative."); yyerror("Alignment must be between 1-16 bits.");
} }
out_SetCurrentSection(out_FindSection(pzName, secttype, -1, bank, 1 << alignment)); out_SetCurrentSection(out_FindSection(pzName, secttype, -1, bank, 1 << alignment));
} }