regseti(emit, count);
const Instr instr = emit_add_instr(emit, ArrayInit);
instr->m_val = (m_uint)type;
- instr->m_val2 = array_base_simple(type)->size;
+ instr->m_val2 = type->array_depth == 1 ? array_base_simple(type)->size : SZ_INT;
emit_local_exp(emit, prim_exp(data));
emit_notpure(emit);
return GW_OK;
sprintf(c, "@%u", args->len);
const Arg *src = mp_vector_at(base, Arg, i);
Type_Decl *td = src->td ? cpy_type_decl(env->gwion->mp, src->td) : NULL;
- Arg arg = { .td = td, .var_decl = { .xid = insert_symbol(c) }};
+ const Array_Sub array = src->var_decl.array ? cpy_array_sub(env->gwion->mp, src->var_decl.array) : NULL;
+ Arg arg = { .td = td, .var_decl = { .xid = insert_symbol(c), .array = array }};
mp_vector_add(env->gwion->mp, &args, Arg, arg);
}
i++;