From 01104d26ea78ae101bb9de537296327fdfea7f8b Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 3 Jun 2004 11:10:30 +0000 Subject: [PATCH] Fixed generation of non optimal code in StructRef() git-svn-id: svn://svn.cc65.org/cc65/trunk@3071 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/expr.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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); -- 2.39.5