]> git.sur5r.net Git - cc65/blobdiff - src/cc65/expr.c
Merge pull request #164 from greg-king5/testsuite
[cc65] / src / cc65 / expr.c
index d615993c42b3ddd7bd216309d97a71ef5da02584..7563645ff0e9bf6e28da7a8c12bcd6fb049ff06e 100644 (file)
@@ -1,7 +1,7 @@
 /* expr.c
 **
 ** 1998-06-21, Ullrich von Bassewitz
-** 2015-04-19, Greg King
+** 2015-06-26, Greg King
 */
 
 
@@ -1713,8 +1713,13 @@ void hie10 (ExprDesc* Expr)
                 } else {
                     Error ("Illegal indirection");
                 }
-                /* The * operator yields an lvalue */
-                ED_MakeLVal (Expr);
+                /* If the expression points to an array, then don't convert the
+                ** address -- it already is the location of the first element.
+                */
+                if (!IsTypeArray (Expr->Type)) {
+                    /* The * operator yields an lvalue */
+                    ED_MakeLVal (Expr);
+                }
             }
             break;