Remove unreachable bank range check

The only case where it is not generated by our own code
(which we ought to be `assume`ing is correct) is when the bank
is used-specified, but that is caught by an earlier check.
This commit is contained in:
ISSOtm
2026-09-18 21:19:37 +02:00
committed by Eldred Habert
parent ef709fade6
commit d43ef53745
+2 -9
View File
@@ -167,15 +167,8 @@ static std::optional<size_t> getPlacement(Section const &section, MemoryLocation
SectionTypeInfo const &typeInfo = section.typeInfo();
do {
if (location.bank < typeInfo.firstBank
|| location.bank >= memory[section.type].size() + typeInfo.firstBank) {
fatal(
"Invalid bank for %s section \"%s\": %" PRIu32,
typeInfo.name,
section.name.c_str(),
location.bank
);
}
assume(location.bank >= section.typeInfo().firstBank);
assume(location.bank <= section.typeInfo().lastBank);
// Switch to the beginning of the next bank
std::deque<FreeSpace> &bankMem = memory[section.type][location.bank - typeInfo.firstBank];