mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-23 22:27:06 +00:00
Fail-safe treat 16-bit alignment as a fixed address even in RGBLINK
RGBASM does this itself, so should not output sections with 16-bit alignment, but an invalid object file could otherwise cause `getPlacement` to infinitely loop.
This commit is contained in:
@@ -321,6 +321,17 @@ static void doSanityChecks(Section §ion) {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// An alignment of 16 is impossible to output from RGBASM, since it's treated as
|
||||
// fixing the address, but is still satisfiable. A fixed address different from the
|
||||
// alignment offset would not be, but we checked for that already above.
|
||||
if (section.isAlignFixed && section.alignMask == (1 << 16) - 1) {
|
||||
assume(!section.isAddressFixed || section.org == section.alignOfs);
|
||||
section.isAddressFixed = true;
|
||||
section.org = section.alignOfs;
|
||||
section.isAlignFixed = false;
|
||||
section.alignMask = section.alignOfs = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void sect_DoSanityChecks() {
|
||||
|
||||
Reference in New Issue
Block a user