From: Jérémie Astor Date: Wed, 6 May 2020 11:24:12 +0000 (+0200) Subject: :bug: Fix Ptr cast X-Git-Tag: nightly~1666 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=7440fd6577d3ccfd17c6a5e20e2b18eae0c0259d;p=gwion.git :bug: Fix Ptr cast --- diff --git a/src/lib/ptr.c b/src/lib/ptr.c index e4b43154..ec09d1fb 100644 --- a/src/lib/ptr.c +++ b/src/lib/ptr.c @@ -52,7 +52,7 @@ static OP_CHECK(opck_ptr_deref) { static OP_CHECK(opck_ptr_cast) { const Exp_Cast* cast = (Exp_Cast*)data; - if(!cast->td->types->td) + if(!cast->td->types || !cast->td->types->td) ERR_N(exp_self(cast)->pos, "'Ptr' needs types to cast") DECL_ON(const Type, t, = type_decl_resolve(env, cast->td)) if(!GET_FLAG(t, check))