X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Ftypecast.c;h=4984192f4f51f25a43d52a9242546209db68494d;hb=b28cf4cfd855ddf3e69eadc1a48d7582fc901e12;hp=406680a7732c91df0f28c9023aee2d585eda6f53;hpb=ac61d6826c614036e5ecdb820fbd90d34cdb43c1;p=cc65 diff --git a/src/cc65/typecast.c b/src/cc65/typecast.c index 406680a77..4984192f4 100644 --- a/src/cc65/typecast.c +++ b/src/cc65/typecast.c @@ -73,9 +73,13 @@ 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 the expression is a function, treat it as pointer to function. + * If the expression is an array, treat it as pointer to first element. + */ if (IsTypeFunc (lval->Type)) { lval->Type = PointerTo (lval->Type); + } else if (IsTypeArray (lval->Type)) { + lval->Type = ArrayToPtr (lval->Type); } /* Remember the old type */