mirror of
https://github.com/gbdev/rgbds.git
synced 2025-12-02 07:47:49 +00:00
Allow PUSHS to be used before a section
Previously, a PUSHS before a SECTION directive would cause rgbasm to crash when encountering a subsequent POPS. This is because the subsequently-called out_setCurrentSection() expected the new section to be non-null, which wasn’t the case in this situation. This has been addressed by allowing the ‘null’ section to be set in this function, and only dereferencing it (to set nPC) if a non-null section is to be set. In practice, this means that PUSHS/POPS can now be used to push/restore a context without a section.
This commit is contained in:
2
test/asm/pops-restore-no-section.out.pipe
Normal file
2
test/asm/pops-restore-no-section.out.pipe
Normal file
@@ -0,0 +1,2 @@
|
||||
ERROR: -(10):
|
||||
Code generation before SECTION directive
|
||||
Reference in New Issue
Block a user