From: cuz Date: Mon, 17 Mar 2003 20:18:58 +0000 (+0000) Subject: Fixed a bug in character literal handling X-Git-Tag: V2.12.0~1663 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8b3ab210be2448ed7ec5e78c0d3f1519bd7dbfce;p=cc65 Fixed a bug in character literal handling git-svn-id: svn://svn.cc65.org/cc65/trunk@2029 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- 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 ||