1
0
mirror of https://github.com/KarolS/millfork.git synced 2024-06-28 23:29:51 +00:00

Fix for volatile fields

This commit is contained in:
Karol Stasiak 2021-06-29 02:28:32 +02:00
parent 431a25d325
commit da862069a7

View File

@ -221,7 +221,7 @@ case class StructureConstant(typ: StructType, fields: List[Constant]) extends Co
override def subbyte(index: Int): Constant = { override def subbyte(index: Int): Constant = {
var offset = 0 var offset = 0
for ((fv, ResolvedFieldDesc(ft, _, arrayIndexTypeAndSize)) <- fields.zip(typ.mutableFieldsWithTypes)) { for ((fv, ResolvedFieldDesc(ft, _, _, arrayIndexTypeAndSize)) <- fields.zip(typ.mutableFieldsWithTypes)) {
// TODO: handle array members? // TODO: handle array members?
val fs = ft.size val fs = ft.size
if (index < offset + fs) { if (index < offset + fs) {
@ -234,7 +234,7 @@ case class StructureConstant(typ: StructType, fields: List[Constant]) extends Co
} }
override def subbyteBe(index: Int, totalSize: Int): Constant = { override def subbyteBe(index: Int, totalSize: Int): Constant = {
var offset = 0 var offset = 0
for ((fv, ResolvedFieldDesc(ft, _, arrayIndexTypeAndSize)) <- fields.zip(typ.mutableFieldsWithTypes)) { for ((fv, ResolvedFieldDesc(ft, _, _, arrayIndexTypeAndSize)) <- fields.zip(typ.mutableFieldsWithTypes)) {
// TODO: handle array members? // TODO: handle array members?
val fs = ft.size val fs = ft.size
if (index < offset + fs) { if (index < offset + fs) {