From d43ef537456d56fab0b64d5fbbfceecc617aa470 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Wed, 16 Sep 2026 21:49:35 -0400 Subject: [PATCH] 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. --- src/link/assign.cpp | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/link/assign.cpp b/src/link/assign.cpp index dd45ae45..9b8d47a2 100644 --- a/src/link/assign.cpp +++ b/src/link/assign.cpp @@ -167,15 +167,8 @@ static std::optional getPlacement(Section const §ion, 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 &bankMem = memory[section.type][location.bank - typeInfo.firstBank];