You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
During a macro expansion, a local label like @Local currently doesn't have a 'scope'. If the same macro is expanded twice within the same caller's scope (before any global label, between two global labels, or after the last global label in a file) - a collision will occur.
During a macro expansion, a anonymous label will immediate collide if the caller is also using anonymous labels 'surrounding' it's expansion. Something like this is problematic:
.macro test
@@:
ld a, 0
.endmacro
@@:
ld a, 1
test
jp @b; <= this will jump to the local label IN THE MACRO DEFINITION
This behavior is unintended and needs to change.
Going forward, only local labels will be allowed in a macro body. Global labels were not allowed before and will continue to not be allowed. Local labels will be allowed and internally be extended with a 'macro expansion ID' to create a unique expansion scope that will also work during recursive macro invocations.
The text was updated successfully, but these errors were encountered:
During a macro expansion, a local label like @Local currently doesn't have a 'scope'. If the same macro is expanded twice within the same caller's scope (before any global label, between two global labels, or after the last global label in a file) - a collision will occur.
During a macro expansion, a anonymous label will immediate collide if the caller is also using anonymous labels 'surrounding' it's expansion. Something like this is problematic:
.macro test
@@:
ld a, 0
.endmacro
@@: ld a, 1 test jp @b; <= this will jump to the local label IN THE MACRO DEFINITION
This behavior is unintended and needs to change.
Going forward, only local labels will be allowed in a macro body. Global labels were not allowed before and will continue to not be allowed. Local labels will be allowed and internally be extended with a 'macro expansion ID' to create a unique expansion scope that will also work during recursive macro invocations.
The text was updated successfully, but these errors were encountered: