From 7440fd6577d3ccfd17c6a5e20e2b18eae0c0259d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Wed, 6 May 2020 13:24:12 +0200 Subject: [PATCH] :bug: Fix Ptr cast --- src/lib/ptr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)) -- 2.43.0