Explicitly assume what was verified earlier by readSection

This commit is contained in:
Rangi
2026-07-15 22:56:43 -04:00
parent b0948566bb
commit ba4a7f2e6a
2 changed files with 3 additions and 0 deletions
+1
View File
@@ -270,6 +270,7 @@ static void placeSection(Section &section) {
assignSection(section, location);
// Update the free space
assume(section.org + section.size <= UINT16_MAX);
uint16_t sectionEnd = section.org + section.size;
bool noLeftSpace = freeSpace.address == section.org;
bool noRightSpace = freeSpace.address + freeSpace.size == sectionEnd;
+2
View File
@@ -181,6 +181,7 @@ static void
}
// Output the section itself
assume(section->size == section->data.size());
fwrite(section->data.data(), 1, section->size, outputFile);
offset += section->size;
@@ -473,6 +474,7 @@ static void writeMapBank(SortedSections const &sectList, SectionType type, uint3
writeEmptySpace(prevEndAddr, sect.org);
assume(sect.org + sect.size <= UINT16_MAX);
prevEndAddr = sect.org + sect.size;
fprintf(mapFile, "\tSECTION: $%04" PRIx16, sect.org);