]> git.sur5r.net Git - cc65/blobdiff - src/cc65/expr.c
Added debugging output
[cc65] / src / cc65 / expr.c
index e5e21e3ce796c9831b388aaf05413a54e6b864bc..92d6013d80c678e0bc59d5f5a24fe1940906f87a 100644 (file)
@@ -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 ||