mirror of
https://github.com/irmen/prog8.git
synced 2026-10-24 18:02:40 +00:00
fix m68k long/string arrays
This commit is contained in:
1 parent
f498f598bf
commit
f10a58ee1b
5 files changed
+17
-9
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user