fix #6344: field-first index writes on #soa[dynamic]T and #soa[]T

This commit is contained in:
Gustavo Konrad
2026-02-28 12:33:57 -03:00
parent 6a6460e824
commit f82d41bc9a
3 changed files with 78 additions and 2 deletions

View File

@@ -4654,6 +4654,8 @@ gb_internal lbAddr lb_build_addr_index_expr(lbProcedure *p, Ast *expr) {
}
}
lbValue val = lb_emit_ptr_offset(p, field, index);
// make sure it's ^T and not [^]T
val.type = alloc_type_multi_pointer_to_pointer(val.type);
return lb_addr(val);
}
@@ -5795,8 +5797,8 @@ gb_internal lbAddr lb_build_addr_internal(lbProcedure *p, Ast *expr) {
if (sub_sel.index.count > 0) {
item = lb_emit_deep_field_gep(p, item, sub_sel);
}
// make sure it's ^T and not [^]T
item.type = alloc_type_multi_pointer_to_pointer(item.type);
// make sure it's ^T and not [^]T
item.type = alloc_type_multi_pointer_to_pointer(item.type);
return lb_addr(item);
} else if (addr.kind == lbAddr_Swizzle) {