ref: 063a22ddf9c822e3a060e45746175a75c6395cc9
parent: 1d9cc01ae1f1c0493f53fb9fb018b7a924455dd7
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Wed Dec 16 06:32:03 EST 2020
`LOAD` blocks cannot create a ROM section Fixes #576
--- a/src/asm/section.c
+++ b/src/asm/section.c
@@ -339,6 +339,9 @@
if (currentLoadSection)
fatalerror("`LOAD` blocks cannot be nested\n");
+ if (sect_HasData(type))
+ error("`LOAD` blocks cannot create a ROM section\n");
+
struct Section *sect = getSection(name, type, org, attribs, false);
loadOffset = curOffset;
--- /dev/null
+++ b/test/asm/load-rom.asm
@@ -1,0 +1,5 @@
+SECTION "Hello", ROM0
+ ld a, 1
+LOAD "Wello", ROM0
+ ld a, 2
+ENDL
--- /dev/null
+++ b/test/asm/load-rom.err
@@ -1,0 +1,3 @@
+ERROR: load-rom.asm(3):
+ `LOAD` blocks cannot create a ROM section
+error: Assembly aborted (1 errors)!