mirror of
https://github.com/gbdev/rgbds.git
synced 2026-08-24 15:54:33 +00:00
Avoid OOM allocation error from invalid too-high bank numbers
This commit is contained in:
@@ -72,6 +72,7 @@ void layout_SetSectionType(SectionType type, uint32_t bank) {
|
||||
bank,
|
||||
typeInfo.lastBank
|
||||
);
|
||||
bank = typeInfo.lastBank;
|
||||
}
|
||||
|
||||
setActiveTypeAndIdx(type, bank - typeInfo.firstBank);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
rom0 1
|
||||
romx 0
|
||||
romx 0xffff_ffff
|
||||
vram 2
|
||||
wram0 1
|
||||
wramx 0
|
||||
|
||||
@@ -2,16 +2,18 @@ error: ROM0 bank 1 does not exist (the maximum is 0)
|
||||
at script-oob-bank-num.link(1)
|
||||
error: ROMX bank 0 does not exist (the minimum is 1)
|
||||
at script-oob-bank-num.link(2)
|
||||
error: VRAM bank 2 does not exist (the maximum is 1)
|
||||
error: ROMX bank 4294967295 does not exist (the maximum is 65535)
|
||||
at script-oob-bank-num.link(3)
|
||||
error: WRAM0 bank 1 does not exist (the maximum is 0)
|
||||
error: VRAM bank 2 does not exist (the maximum is 1)
|
||||
at script-oob-bank-num.link(4)
|
||||
error: WRAMX bank 0 does not exist (the minimum is 1)
|
||||
error: WRAM0 bank 1 does not exist (the maximum is 0)
|
||||
at script-oob-bank-num.link(5)
|
||||
error: WRAMX bank 8 does not exist (the maximum is 7)
|
||||
error: WRAMX bank 0 does not exist (the minimum is 1)
|
||||
at script-oob-bank-num.link(6)
|
||||
error: OAM bank 1 does not exist (the maximum is 0)
|
||||
error: WRAMX bank 8 does not exist (the maximum is 7)
|
||||
at script-oob-bank-num.link(7)
|
||||
error: HRAM bank 1 does not exist (the maximum is 0)
|
||||
error: OAM bank 1 does not exist (the maximum is 0)
|
||||
at script-oob-bank-num.link(8)
|
||||
Linking failed with 8 errors
|
||||
error: HRAM bank 1 does not exist (the maximum is 0)
|
||||
at script-oob-bank-num.link(9)
|
||||
Linking failed with 9 errors
|
||||
|
||||
Reference in New Issue
Block a user