From: cuz Date: Sun, 9 Jan 2005 21:17:19 +0000 (+0000) Subject: Fixed a bug (hopefully). X-Git-Tag: V2.12.0~472 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e06d9d0d84491f58c826d6d84a7a583bb556a72e;p=cc65 Fixed a bug (hopefully). The ArrayRef() does really need a rewrite, now since we have better expression info. git-svn-id: svn://svn.cc65.org/cc65/trunk@3364 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index b47040096..d2e8b7234 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -799,7 +799,7 @@ static void Primary (ExprDesc* E) static void ArrayRef (ExprDesc* Expr) -/* Handle an array reference */ +/* Handle an array reference. This function needs a rewrite. */ { int ConstBaseAddr; ExprDesc SubScript; @@ -909,7 +909,7 @@ static void ArrayRef (ExprDesc* Expr) /* It's a pointer, so we do have to load it into the primary * first (if it's not already there). */ - if (ConstBaseAddr) { + if (ConstBaseAddr || ED_IsLVal (Expr)) { LoadExpr (CF_NONE, Expr); ED_MakeRValExpr (Expr); }