1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-05-31 18:41:30 +00:00

#98: Warning about a missing call to init_rw_memory

This commit is contained in:
Karol Stasiak 2021-02-03 09:58:39 +01:00
parent 919f11af2e
commit 958c1c09e7

View File

@ -594,6 +594,9 @@ abstract class AbstractAssembler[T <: AbstractCode](private val program: Program
val db = mem.banks("default")
val ib = mem.banks(ivBank)
val size = rwDataEnd - rwDataStart
if (size > 0 && !labelMap.contains("init_rw_memory")) {
log.warn("The program contains initialized variables, but it never calls init_rw_memory().")
}
if (size < 0) log.fatal("Negative writable memory size. It's a compiler bug.")
val ivAddr = codeAllocators(ivBank).allocateBytes(ib, options, size, initialized = true, writeable = false, AllocationLocation.High, NoAlignment)
unimportantLabelMap += "__rwdata_init_start" -> (ib.index -> ivAddr)