mirror of
https://github.com/gbdev/rgbds.git
synced 2026-09-22 13:47:05 +00:00
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:
+2
-9
@@ -167,15 +167,8 @@ static std::optional<size_t> 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<FreeSpace> &bankMem = memory[section.type][location.bank - typeInfo.firstBank];
|
||||
|
||||
Reference in New Issue
Block a user