]> Nishi Git Mirror - gwion.git/commitdiff
:bomb: shred->gc handling
authorJérémie Astor <fennecdjay@gmail.com>
Sun, 5 Sep 2021 21:35:09 +0000 (23:35 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Sun, 5 Sep 2021 21:35:09 +0000 (23:35 +0200)
src/lib/object_op.c
src/lib/opfunc.c

index d06c65e6532baeef16b7782383ec6fb528802701..c01ac8873bc792cbd58362eb346aaa2540d78b25 100644 (file)
@@ -36,20 +36,21 @@ static OP_CHECK(opck_object_at) {
   CHECK_BO(isa(bin->lhs->type, bin->rhs->type));
   return bin->rhs->type;
 }
-
+/*
 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")*/;
+  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"):
 }
-
+*/
 static OP_EMIT(opem_object_at) {
-  const Exp_Binary *bin = (Exp_Binary *)data;
-  if(!exp_func(bin->lhs)) {
-    const Instr addref = emit_add_instr(emit, RegAddRef);
-    addref->m_val      = -SZ_INT * 2;
-  }
+//  const Exp_Binary *bin = (Exp_Binary *)data;
+//  if(!exp_func(bin->lhs)) {
+  const Instr addref = emit_add_instr(emit, RegAddRef);
+  addref->m_val      = -SZ_INT * 2;
+//  }
   (void)emit_add_instr(emit, ObjectAssign);
   return GW_OK;
 }
index 4bef3204571151018f4de27d823d2058f3a60245..1b8fc0c4a046b3e83c528da663f753344156547d 100644 (file)
@@ -134,7 +134,7 @@ OP_EMIT(opem_new) {
                                    unary->ctor.td->array, 0));
   // we don't need gc for arrays?
   // also when in rewrote exp
-  if(!(unary->ctor.td->array || unary->ctor.exp))
+//  if(!(unary->ctor.td->array || unary->ctor.exp))
     emit_gc(emit, -SZ_INT);
   return GW_OK;
 }