From 8b99752cd32f06bac7822adc3537a2cea200d1d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Tue, 3 Aug 2021 20:12:01 +0200 Subject: [PATCH] :bomb: Fix memleak (hopefully) --- src/lib/object_op.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/object_op.c b/src/lib/object_op.c index d18eb2af..26b93c77 100644 --- a/src/lib/object_op.c +++ b/src/lib/object_op.c @@ -37,15 +37,16 @@ static OP_CHECK(opck_object_at) { return bin->rhs->type; } -static bool is_new(const Exp exp) { - return exp->exp_type == ae_exp_call && +static bool exp_func(const Exp exp) { +// was is_new + return exp->exp_type == ae_exp_call /*&& exp->d.exp_call.func->exp_type == ae_exp_dot && - !strcmp(s_name(exp->d.exp_call.func->type->info->func->def->base->xid), "new"); + !strcmp(s_name(exp->d.exp_call.func->type->info->func->def->base->xid), "new")*/; } static OP_EMIT(opem_object_at) { const Exp_Binary *bin = (Exp_Binary *)data; - if(!is_new(bin->lhs)) { + if(!exp_func(bin->lhs)) { const Instr addref = emit_add_instr(emit, RegAddRef); addref->m_val = -SZ_INT * 2; } -- 2.43.0