Fix bugs with LOAD section size

LOAD blocks did not properly update their parent's size until after closed
Additionally, section size wasn't correctly sanitized inside LOAD blocks
This commit is contained in:
ISSOtm
2020-09-03 12:06:13 +02:00
parent e05321356b
commit 9d62b4b9bb
12 changed files with 34 additions and 9 deletions

5
test/asm/load-begin.asm Normal file
View File

@@ -0,0 +1,5 @@
SECTION "test", ROM0
LOAD "RAM", WRAM0
ld a, 5
ENDL
db 1

0
test/asm/load-begin.err Normal file
View File

0
test/asm/load-begin.out Normal file
View File

View File

@@ -0,0 +1 @@
>

View File

@@ -0,0 +1,5 @@
SECTION "Overflow", ROM0
ds $6000
LOAD "oops",WRAM0
ds $2001
ENDL

View File

@@ -0,0 +1,2 @@
ERROR: load-overflow.asm(4):
Section 'Overflow' grew too big (max size = 0x8000 bytes, reached 0x8001).

View File

5
test/asm/load-trail.asm Normal file
View File

@@ -0,0 +1,5 @@
SECTION "test", ROM0
db 1
LOAD "RAM", WRAM0
ld a, 5
ENDL

0
test/asm/load-trail.err Normal file
View File

0
test/asm/load-trail.out Normal file
View File

View File

@@ -0,0 +1 @@
>