From: fennecdjay Date: Sat, 24 Aug 2019 10:29:34 +0000 (+0200) Subject: :bug: Ensure one can't 'new' ref types X-Git-Tag: nightly~2267 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=cefe83c1e7018933a8784ffeec7f54c3ed4c14f1;p=gwion.git :bug: Ensure one can't 'new' ref types --- diff --git a/src/lib/opfunc.c b/src/lib/opfunc.c index ace7ddef..1530b3b7 100644 --- a/src/lib/opfunc.c +++ b/src/lib/opfunc.c @@ -98,6 +98,8 @@ OP_CHECK(opck_new) { const Exp_Unary* unary = (Exp_Unary*)data; SET_FLAG(unary->td, ref); DECL_OO(const Type, t, = known_type(env, unary->td)) + if(type_ref(t)) + ERR_N(td_pos(unary->td), _("can't use 'new' on ref type '%s'\n"), t->name) UNSET_FLAG(unary->td, ref); if(unary->td->array) CHECK_BO(check_exp_array_subscripts(env, unary->td->array->exp))