From: Jérémie Astor Date: Tue, 15 Dec 2020 00:34:44 +0000 (+0100) Subject: :bomb: Fix object_release and clean. X-Git-Tag: nightly~1105^2~16 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=fa087dfd82942672688485a0969736532ff57a1a;p=gwion.git :bomb: Fix object_release and clean. --- 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) {