From 80042d5f152e7283d5be87a6f7016e9b5917f695 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 15 Mar 2021 19:18:45 +0100 Subject: [PATCH] :bug: Fix array bug --- plug | 2 +- src/emit/emit.c | 3 +-- src/vm/vm_code.c | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/plug b/plug index 2d8a4849..ea2bba42 160000 --- a/plug +++ b/plug @@ -1 +1 @@ -Subproject commit 2d8a48494371a6a11514647800225c531bff6b86 +Subproject commit ea2bba4277586e094d2083bcca456a823e67c466 diff --git a/src/emit/emit.c b/src/emit/emit.c index 10f78c68..b03152b5 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -282,7 +282,6 @@ ANN static void struct_expand(const Emitter emit, const Type t) { const Instr instr = emit_add_instr(emit, Reg2RegDeref); instr->m_val = -SZ_INT; instr->m_val2 = t->size; -// regpush(emit, t->size - SZ_INT); } @@ -302,7 +301,7 @@ ANN static void emit_pre_constructor_array(const Emitter emit, const Type type) regpop(emit, SZ_INT); const Instr pc = emit_add_instr(emit, Goto); pc->m_val = start_index; - top->m_val = emit_code_size(emit) - !!emit->env->func; + top->m_val = emit_code_size(emit); regpop(emit, SZ_INT*3); emit_add_instr(emit, ArrayPost); } diff --git a/src/vm/vm_code.c b/src/vm/vm_code.c index 3c1194c2..c1d7e013 100644 --- a/src/vm/vm_code.c +++ b/src/vm/vm_code.c @@ -37,7 +37,7 @@ ANN void free_vmcode(VM_Code a, Gwion gwion) { } static inline uint isgoto(const unsigned opcode) { - return opcode == eGoto || + return opcode == eGoto || opcode == eArrayTop || opcode == eBranchEqInt || opcode == eBranchNeqInt || opcode == eBranchEqFloat || opcode == eBranchNeqFloat; } -- 2.43.0