Fixes #7488
This commit is contained in:
Jeroen van Rijn
2026-09-01 22:27:46 +02:00
parent 916615a895
commit 06c145c220

View File

@@ -480,10 +480,14 @@ _append_soa_elems :: proc(#no_alias array: ^$T/#soa[dynamic]$E, zero_memory: boo
footer := raw_soa_footer(array)
if size_of(E) > 0 && arg_len > 0 {
offset := footer.len
FIELD_COUNT :: len(E) when intrinsics.type_is_array(E) else intrinsics.type_struct_field_count(E)
// Advance len before the copy, soa_copy_from_slice needs the final len to be set
when FIELD_COUNT != 0 {
offset := footer.len
}
footer.len += arg_len
when FIELD_COUNT == 0 {
// do nothing
} else when FIELD_COUNT <= 16 && ODIN_OPTIMIZATION_MODE <= .Size {