mirror of
https://github.com/KarolS/millfork.git
synced 2025-01-28 02:34:21 +00:00
Fix array fields in certain contexts
This commit is contained in:
parent
b66435d06b
commit
7530b382a8
@ -407,12 +407,12 @@ object AbstractExpressionCompiler {
|
||||
log.error(s"Type `$targetType` doesn't have field named `$actualFieldName`", expr.position)
|
||||
ok = false
|
||||
} else {
|
||||
if (tuples.head.arrayIndexTypeAndSize.isDefined) ??? // TODO
|
||||
val subv = tuples.head
|
||||
pointerWrap match {
|
||||
case 0 =>
|
||||
currentType = tuples.head.typ
|
||||
currentType = if (subv.arrayIndexTypeAndSize.isDefined) env.get[Type]("pointer." + subv.typ) else subv.typ
|
||||
case 1 =>
|
||||
currentType = env.get[Type]("pointer." + tuples.head.typ)
|
||||
currentType = env.get[Type]("pointer." + subv.typ)
|
||||
case 2 =>
|
||||
currentType = env.get[Type]("pointer")
|
||||
case 10 | 11 =>
|
||||
|
@ -2372,11 +2372,10 @@ class Environment(val parent: Option[Environment], val prefix: String, val cpuFa
|
||||
builder.toList
|
||||
case s: UnionType =>
|
||||
val builder = new ListBuffer[Subvariable]
|
||||
for(FieldDesc(typeName, fieldName, vol1, arraySize) <- s.fields) {
|
||||
val typ = get[VariableType](typeName)
|
||||
for(ResolvedFieldDesc(typ, fieldName, vol1, indexTypeAndCount) <- s.mutableFieldsWithTypes) {
|
||||
val suffix = "." + fieldName
|
||||
builder += Subvariable(suffix, 0, vol1, typ)
|
||||
if (arraySize.isEmpty) {
|
||||
if (indexTypeAndCount.isEmpty) {
|
||||
builder ++= getSubvariables(typ).map {
|
||||
case Subvariable(innerSuffix, innerOffset, vol2, innerType, innerSize) => Subvariable(suffix + innerSuffix, innerOffset, vol1 || vol2, innerType, innerSize)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user