X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fcc65%2Fexpr.c;h=92d6013d80c678e0bc59d5f5a24fe1940906f87a;hb=98da4b581175232d89630f5c19f22e37a7588c7b;hp=e5e21e3ce796c9831b388aaf05413a54e6b864bc;hpb=c5868d30c0eeb2ad90dc0139c5b385c73fa7d4aa;p=cc65 diff --git a/src/cc65/expr.c b/src/cc65/expr.c index e5e21e3ce..92d6013d8 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -365,7 +365,7 @@ static void LoadConstant (unsigned Flags, ExprDesc* Expr) -static int kcalc (int tok, long val1, long val2) +static int kcalc (token_t tok, long val1, long val2) /* Calculate an operation with left and right operand constant. */ { switch (tok) { @@ -554,7 +554,7 @@ static unsigned FunctionParamList (FuncDesc* Func) * each parameter separately, or creating the parameter frame once and then * storing into this frame. * The function returns the size of the parameters pushed. - */ + */ { ExprDesc lval; @@ -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 ||