]> Nishi Git Mirror - gwion.git/commitdiff
:art: use ensure_traverse for operator new
authorJérémie Astor <fennecdjay@gmail.com>
Fri, 10 Sep 2021 11:13:42 +0000 (13:13 +0200)
committerJérémie Astor <fennecdjay@gmail.com>
Fri, 10 Sep 2021 11:13:42 +0000 (13:13 +0200)
src/lib/opfunc.c

index 1cc26d582e4f9d5def932f11706b3878b4e47aed..57045b6189cadb18fe8a98e30a13a9380d6ea9d1 100644 (file)
@@ -99,6 +99,7 @@ ANN Type check_td(const Env env, Type_Decl *td);
 OP_CHECK(opck_new) {
   Exp_Unary *unary = (Exp_Unary *)data;
   DECL_ON(const Type, t, = known_type(env, unary->ctor.td));
+  CHECK_BN(ensure_traverse(env, t));
   if (type_ref(t))
     ERR_N(unary->ctor.td->pos, _("can't use 'new' on ref type '%s'\n"), t->name);
   if (tflag(t, tflag_infer))