Fix dynamic array index = value with const value initializing to 0

This commit is contained in:
korvahkh
2024-02-02 15:27:39 -06:00
parent cec08114fd
commit 8530829ca4

View File

@@ -3657,7 +3657,7 @@ gb_internal void lb_build_addr_compound_lit_populate(lbProcedure *p, Slice<Ast *
Ast *elem = elems[i];
if (elem->kind == Ast_FieldValue) {
ast_node(fv, FieldValue, elem);
if (lb_is_elem_const(fv->value, et)) {
if (bt->kind != Type_DynamicArray && lb_is_elem_const(fv->value, et)) {
continue;
}
if (is_ast_range(fv->field)) {