From: cuz Date: Thu, 3 Jun 2004 11:10:30 +0000 (+0000) Subject: Fixed generation of non optimal code in StructRef() X-Git-Tag: V2.12.0~761 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=01104d26ea78ae101bb9de537296327fdfea7f8b;p=cc65 Fixed generation of non optimal code in StructRef() git-svn-id: svn://svn.cc65.org/cc65/trunk@3071 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index cc3fab011..00fe4990f 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1247,10 +1247,10 @@ static void StructRef (ExprDesc* Expr) return; } - /* If we have a struct pointer that is not already in the primary, load - * it now. + /* If we have a struct pointer that is an lvalue and not already in the + * primary, load it now. */ - if (IsTypePtr (Expr->Type)) { + if (ED_IsLVal (Expr) && IsTypePtr (Expr->Type)) { /* Load into the primary */ ExprLoad (CF_NONE, Expr);