mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +00:00
@@ -751,6 +751,10 @@ static void beginExpansion(size_t distance, uint8_t skip,
|
||||
char const *str, size_t size, bool owned,
|
||||
char const *name)
|
||||
{
|
||||
/* Do not expand empty strings */
|
||||
if (!size)
|
||||
return;
|
||||
|
||||
distance += lexerState->expansionOfs; /* Distance argument is relative to read offset! */
|
||||
/* Increase the total length of all parents, and return the topmost one */
|
||||
struct Expansion *parent = NULL;
|
||||
|
||||
6
test/asm/expand-empty-string.asm
Normal file
6
test/asm/expand-empty-string.asm
Normal file
@@ -0,0 +1,6 @@
|
||||
test: MACRO
|
||||
v equs "X"
|
||||
X equs "" ; should not be expanded
|
||||
\1
|
||||
ENDM
|
||||
test v 0
|
||||
3
test/asm/expand-empty-string.err
Normal file
3
test/asm/expand-empty-string.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ERROR: expand-empty-string.asm(6) -> expand-empty-string.asm::test(4):
|
||||
syntax error, unexpected number
|
||||
error: Assembly aborted (1 error)!
|
||||
0
test/asm/expand-empty-string.out
Normal file
0
test/asm/expand-empty-string.out
Normal file
3
test/asm/expand-empty-string.simple.err
Normal file
3
test/asm/expand-empty-string.simple.err
Normal file
@@ -0,0 +1,3 @@
|
||||
ERROR: expand-empty-string.asm(6) -> expand-empty-string.asm::test(4):
|
||||
syntax error
|
||||
error: Assembly aborted (1 error)!
|
||||
Reference in New Issue
Block a user