]> Nishi Git Mirror - gwion.git/commitdiff
:bomb: Fix memleak (hopefully)
authorJérémie Astor <fennecdjay@gmail.com>
Tue, 3 Aug 2021 18:12:01 +0000 (20:12 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Tue, 3 Aug 2021 18:12:01 +0000 (20:12 +0200)
src/lib/object_op.c

index d18eb2afa2cd667e1f003e2977d3a42cec581962..26b93c776bc3f2382489f4d298630555abae59c9 100644 (file)
@@ -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;
   }