fix m68k long/string arrays

This commit is contained in:
Irmen de Jong committed 2026-07-12 12:09:44 +02:00
1 parent f498f598bf
commit f10a58ee1b
5 files changed
+17 -9

No files matched your search

+4 -1
View File
@@ -191,7 +191,10 @@ class DataType private constructor(
require(!elementDt.isPointer) { "use other array constructor for arrays of pointers" }
// TODO: on 32-bit targets (m68k), str arrays should be arrays of LONG (4-byte pointers),
// but this requires systematically handling str as a 4-byte type across the entire compiler.
val actualElementDt = if(elementDt==BaseDataType.STR) BaseDataType.UWORD else elementDt
val actualElementDt = if(elementDt==BaseDataType.STR) {
val target = memsizer as? ICompilationTarget
if(target != null && target.POINTER_MEM_SIZE > 2u) BaseDataType.LONG else BaseDataType.UWORD
} else elementDt
if(actualElementDt.isNumericOrBool)
return DataType(BaseDataType.ARRAY, actualElementDt, null)
else