diff --git a/src/cc65/typecast.c b/src/cc65/typecast.c index 406680a77..ec9409a12 100644 --- a/src/cc65/typecast.c +++ b/src/cc65/typecast.c @@ -73,8 +73,10 @@ int TypeCast (ExprDesc* lval) /* Read the expression we have to cast */ k = hie10 (lval); - /* If the expression is a function, treat it as pointer-to-function */ - if (IsTypeFunc (lval->Type)) { + /* If the expression is a function or an array, treat it as + * "pointer to type" + */ + if (IsTypeFunc (lval->Type) || IsTypeArray (lval->Type)) { lval->Type = PointerTo (lval->Type); }