shithub: rgbds

Download patch

ref: 822e4e7c44a8b7e1d1d2e2172f34ac57aec6a06e
parent: 6a8ae643d5e900b2dbe7d741a1f14df5912cede8
author: Jakub Kądziołka <kuba@kadziolka.net>
date: Sun Oct 11 20:27:54 EDT 2020

Report error when aligning outside of a section

--- a/src/asm/section.c
+++ b/src/asm/section.c
@@ -378,6 +378,7 @@
 
 void sect_AlignPC(uint8_t alignment, uint16_t offset)
 {
+	checksection();
 	struct Section *sect = sect_GetSymbolSection();
 
 	if (sect->org != -1) {
--- /dev/null
+++ b/test/asm/align-pc-outside-section.asm
@@ -1,0 +1,1 @@
+align 1
--- /dev/null
+++ b/test/asm/align-pc-outside-section.err
@@ -1,0 +1,2 @@
+FATAL: align-pc-outside-section.asm(1):
+    Code generation before SECTION directive