From 2c68d7bc3bfe1d937f1113fab8c32e271bb93eec Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Thu, 12 May 2022 22:46:12 +0200 Subject: [PATCH] :art: Update BMI again --- plug | 2 +- src/emit/emit.c | 2 +- src/parse/partial.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plug b/plug index 862a5199..5a583451 160000 --- a/plug +++ b/plug @@ -1 +1 @@ -Subproject commit 862a51991bef3cc4c86bf195101780b61563ca25 +Subproject commit 5a583451cd50f26867cf18c9bd309e3cc0f523d2 diff --git a/src/emit/emit.c b/src/emit/emit.c index ce61d198..737c63b7 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -650,7 +650,7 @@ ANN static m_bool emit_prim_array(const Emitter emit, const Array_Sub *data) { 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; diff --git a/src/parse/partial.c b/src/parse/partial.c index b78fa535..94b5dac4 100644 --- a/src/parse/partial.c +++ b/src/parse/partial.c @@ -23,7 +23,8 @@ ANN static Arg_List partial_arg_list(const Env env, const Arg_List base, const E 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++; -- 2.43.0