mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
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:
@@ -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));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user