From fa087dfd82942672688485a0969736532ff57a1a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 15 Dec 2020 01:34:44 +0100 Subject: [PATCH] :bomb: Fix object_release and clean. --- src/emit/emit.c | 3 +-- src/lib/object.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/emit/emit.c b/src/emit/emit.c index 515654ce..ef69ec37 100644 --- a/src/emit/emit.c +++ b/src/emit/emit.c @@ -720,7 +720,7 @@ ANN static m_bool decl_static(const Emitter emit, const Exp_Decl *decl, const Va CHECK_BB(emit_instantiate_decl(emit, v->type, decl->td, var_decl->array, is_ref)) CHECK_BB(emit_dot_static_data(emit, v, 1)) emit_add_instr(emit, Assign); - (void)emit_addref(emit, 0); +// (void)emit_addref(emit, 0); regpop(emit, SZ_INT); emit->code = code; return GW_OK; @@ -1339,7 +1339,6 @@ ANN static Instr spork_ini(const Emitter emit, const struct Sporker *sp) { return instr; } regpushi(emit, (m_uint)sp->type); - const Func f = !sp->code ? sp->exp->d.exp_call.m_func : NULL; const Instr instr = emit_add_instr(emit, ForkIni); instr->m_val = (m_uint)sp->vm_code; instr->m_val2 = sp->type->size; diff --git a/src/lib/object.c b/src/lib/object.c index c4a02a64..d89f4b78 100644 --- a/src/lib/object.c +++ b/src/lib/object.c @@ -68,7 +68,7 @@ ANN void __release(const M_Object o, const VM_Shred shred) { do { if(!t->nspc) continue; - if(isa(t, shred->info->vm->gwion->type[et_union]) > 0) { + if(isa(t, shred->info->vm->gwion->type[et_union]) < 0) { struct scope_iter iter = { t->nspc->info->value, 0, 0 };\ Value v; while(scope_iter(&iter, &v) > 0) { -- 2.43.0