From a9e81e01aa58929db29aa47a8b058debc5b77a77 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Wed, 25 Mar 2026 14:08:39 +0000 Subject: [PATCH] Allow addressing of an index expression of an soa slice/dynamic array --- src/check_expr.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index b5270c8e9..e507e81e5 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -8896,8 +8896,14 @@ gb_internal bool check_set_index_data(Operand *o, Type *t, bool indirection, i64 case Type_Struct: if (t->Struct.soa_kind != StructSoa_None) { - if (t->Struct.soa_kind == StructSoa_Fixed) { + switch (t->Struct.soa_kind) { + case StructSoa_Fixed: *max_count = t->Struct.soa_count; + break; + case StructSoa_Slice: + case StructSoa_Dynamic: + indirection = o->mode != Addressing_Constant; + break; } o->type = t->Struct.soa_elem; if (o->mode == Addressing_SoaVariable || o->mode == Addressing_Variable || indirection) {