mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Fix expansions that start from the end of another expansion (#839)
Do not free an expansion until its offset is *past* its size. This means potentially freeing a nested stack of expansions all at once. Fixes #696
This commit is contained in:
@@ -3,5 +3,6 @@ warning: equs-newline.asm(3): [-Wuser]
|
||||
while expanding symbol "ACT"
|
||||
warning: equs-newline.asm(3): [-Wuser]
|
||||
Second
|
||||
while expanding symbol "ACT"
|
||||
warning: equs-newline.asm(4): [-Wuser]
|
||||
Third
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
recurse EQUS "recurse "
|
||||
recurse EQUS "recurse"
|
||||
recurse
|
||||
|
||||
; FIXME: also handle the following:
|
||||
; recurse EQUS "recurse"
|
||||
; recurse
|
||||
|
||||
@@ -1,6 +1,2 @@
|
||||
recurse EQUS "\{recurse\} "
|
||||
recurse EQUS "\{recurse\}"
|
||||
{recurse}
|
||||
|
||||
; FIXME: also handle the following:
|
||||
; recurse EQUS "\{recurse\}"
|
||||
; {recurse}
|
||||
|
||||
@@ -1,67 +1,67 @@
|
||||
FATAL: interpolation-recursion.asm(2):
|
||||
Recursion limit (64) exceeded
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse} "
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
while expanding symbol "{recurse}"
|
||||
|
||||
@@ -16,12 +16,8 @@ SECTION "calls", ROM0[0]
|
||||
|
||||
|
||||
defRST: MACRO
|
||||
; FIXME: This is required, otherwise the lexer does not paste the two tokens
|
||||
ADDR equs "$\1"
|
||||
SECTION "rst\1", ROM0[ADDR]
|
||||
|
||||
rst\1:
|
||||
PURGE ADDR
|
||||
SECTION "rst\1", ROM0[$\1]
|
||||
rst\1:
|
||||
ENDM
|
||||
defRST 00
|
||||
defRST 08
|
||||
|
||||
@@ -62,6 +62,7 @@ EOF
|
||||
cat > quote\"file.err <<EOF
|
||||
warning: quote"file.asm(1): [-Wuser]
|
||||
quote"file.asm
|
||||
while expanding symbol "__FILE__"
|
||||
EOF
|
||||
fi
|
||||
|
||||
|
||||
@@ -1,19 +1,27 @@
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(4): [-Wuser]
|
||||
_u1
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~1(6): [-Wuser]
|
||||
_u2
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~2(6): [-Wuser]
|
||||
_u3
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(12) -> unique-id.asm::m(8): [-Wuser]
|
||||
_u1
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(4): [-Wuser]
|
||||
_u4
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~1(6): [-Wuser]
|
||||
_u5
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(5) -> unique-id.asm::m::REPT~2(6): [-Wuser]
|
||||
_u6
|
||||
while expanding symbol "warn_unique"
|
||||
warning: unique-id.asm(14) -> unique-id.asm::m(8): [-Wuser]
|
||||
_u4
|
||||
while expanding symbol "warn_unique"
|
||||
FATAL: unique-id.asm(15):
|
||||
Macro argument '\@' not defined
|
||||
while expanding symbol "warn_unique"
|
||||
|
||||
@@ -14,12 +14,8 @@ SECTION "calls", ROM0[0]
|
||||
|
||||
|
||||
defRST: MACRO
|
||||
; FIXME: This is required, otherwise the lexer does not paste the two tokens
|
||||
ADDR equs "$\1"
|
||||
SECTION "rst\1", ROM0[ADDR]
|
||||
|
||||
rst\1:
|
||||
PURGE ADDR
|
||||
SECTION "rst\1", ROM0[$\1]
|
||||
rst\1:
|
||||
ENDM
|
||||
defRST 00
|
||||
defRST 08
|
||||
|
||||
Reference in New Issue
Block a user