Skip to content

Commit

Permalink
#98: Warning about a missing call to init_rw_memory
Browse files Browse the repository at this point in the history
  • Loading branch information
KarolS committed Feb 3, 2021
1 parent 919f11a commit 958c1c0
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/scala/millfork/output/AbstractAssembler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 958c1c0

Please sign in to comment.