bentley/rgbds — pull request #32 by chastai (2014-10-05 15:55:51+00:00)
Title: Fix bug: rgbasm segfault when \@ is used outside a macro

The problem occurs when \@ is accessed outside the definition of a
macro and is not between "" or {}, or when it is used in an argument of
a macro call, i.e. when the access is processed by PutUniqueArg().

PutUniqueArg(), puts back the string value of \@ to the lexer's buffer
(to substitute \@ by the unique label string).
When \@ is not defined, sym_FindMacroArg(-1) returns NULL, which
yyunputstr() doesn't expect and crashes.

Solution:
Generate an error when \@ is not defined.

Regression test:

SECTION "HOME", HOME
ld a,\@

Will segfault.
On the fixed version, it will return an error as \@ is not available.