]> Nishi Git Mirror - gwion.git/commitdiff
:bug: Fix Ptr cast
authorJérémie Astor <astor.jeremie@wanadoo.fr>
Wed, 6 May 2020 11:24:12 +0000 (13:24 +0200)
committerJérémie Astor <astor.jeremie@wanadoo.fr>
Wed, 6 May 2020 11:24:12 +0000 (13:24 +0200)
src/lib/ptr.c

index e4b4315489da942ac04427f1c127721933ba44ed..ec09d1fba4c98ca7218c81624224a673d7399b8f 100644 (file)
@@ -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))