mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-05 21:37:07 +00:00
Explicitly assume what was verified earlier by readSection
This commit is contained in:
@@ -270,6 +270,7 @@ static void placeSection(Section §ion) {
|
|||||||
assignSection(section, location);
|
assignSection(section, location);
|
||||||
|
|
||||||
// Update the free space
|
// Update the free space
|
||||||
|
assume(section.org + section.size <= UINT16_MAX);
|
||||||
uint16_t sectionEnd = section.org + section.size;
|
uint16_t sectionEnd = section.org + section.size;
|
||||||
bool noLeftSpace = freeSpace.address == section.org;
|
bool noLeftSpace = freeSpace.address == section.org;
|
||||||
bool noRightSpace = freeSpace.address + freeSpace.size == sectionEnd;
|
bool noRightSpace = freeSpace.address + freeSpace.size == sectionEnd;
|
||||||
|
|||||||
@@ -181,6 +181,7 @@ static void
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Output the section itself
|
// Output the section itself
|
||||||
|
assume(section->size == section->data.size());
|
||||||
fwrite(section->data.data(), 1, section->size, outputFile);
|
fwrite(section->data.data(), 1, section->size, outputFile);
|
||||||
offset += section->size;
|
offset += section->size;
|
||||||
|
|
||||||
@@ -473,6 +474,7 @@ static void writeMapBank(SortedSections const §List, SectionType type, uint3
|
|||||||
|
|
||||||
writeEmptySpace(prevEndAddr, sect.org);
|
writeEmptySpace(prevEndAddr, sect.org);
|
||||||
|
|
||||||
|
assume(sect.org + sect.size <= UINT16_MAX);
|
||||||
prevEndAddr = sect.org + sect.size;
|
prevEndAddr = sect.org + sect.size;
|
||||||
|
|
||||||
fprintf(mapFile, "\tSECTION: $%04" PRIx16, sect.org);
|
fprintf(mapFile, "\tSECTION: $%04" PRIx16, sect.org);
|
||||||
|
|||||||
Reference in New Issue
Block a user