mirror of
https://github.com/gbdev/rgbds.git
synced 2026-05-11 04:11:42 +00:00
Prevent purging referenced symbols
This is an immediate fix for #492, although #342 is needed to implement the desired functionality.
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
SECTION "test", ROM0 ; Important: do not purge this!
|
||||
|
||||
dw ref
|
||||
PURGE ref
|
||||
|
||||
OK:
|
||||
PURGE OK
|
||||
|
||||
dw NotOK
|
||||
NotOK:
|
||||
PURGE NotOK
|
||||
|
||||
EvenLessOK:
|
||||
dw EvenLessOK
|
||||
PURGE EvenLessOK
|
||||
|
||||
SECTION "fixed", ROM0[0]
|
||||
|
||||
Maybe:
|
||||
dw Maybe
|
||||
; This is currently fine because the expression above is fully evaluated
|
||||
; above, so it's fine as of now... but changing it might make sense
|
||||
PURGE Maybe
|
||||
@@ -0,0 +1,7 @@
|
||||
ERROR: purge-ref.asm(4):
|
||||
Symbol "ref" is referenced and thus cannot be purged
|
||||
ERROR: purge-ref.asm(11):
|
||||
Symbol "NotOK" is referenced and thus cannot be purged
|
||||
ERROR: purge-ref.asm(15):
|
||||
Symbol "EvenLessOK" is referenced and thus cannot be purged
|
||||
error: Assembly aborted (3 errors)!
|
||||
Reference in New Issue
Block a user