X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fexpr.c;h=92d6013d80c678e0bc59d5f5a24fe1940906f87a;hb=98da4b581175232d89630f5c19f22e37a7588c7b;hp=df1ef8baa014446b534d6d7191f6e62f4d673d8e;hpb=c008e555b225d90550dc720585e1937ab299b665;p=cc65 diff --git a/src/cc65/expr.c b/src/cc65/expr.c index df1ef8baa..92d6013d8 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1105,9 +1105,10 @@ static int arrayref (int k, ExprDesc* lval) RemoveCode (Mark1); /* Handle constant base array on stack. Be sure NOT to - * handle pointers the same way, this won't work. + * handle pointers the same way, and check for character literals + * (both won't work). */ - if (IsTypeArray (tptr1) && + if (IsTypeArray (tptr1) && lval->Flags != (E_MCONST | E_TLIT) && ((lval->Flags & ~E_MCTYPE) == E_MCONST || (lval->Flags & ~E_MCTYPE) == E_MLOCAL || (lval->Flags & E_MGLOBAL) != 0 ||