From: uz Date: Thu, 8 Oct 2009 09:54:46 +0000 (+0000) Subject: Fixed an error with r4329: In case of a struct pointer the qualifiers of the X-Git-Tag: V2.13.1~181 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=17d592352c0936cbd69b0314c2ad08f9d2ba2f10;p=cc65 Fixed an error with r4329: In case of a struct pointer the qualifiers of the pointers had been used, not the qualifiers of the struct. git-svn-id: svn://svn.cc65.org/cc65/trunk@4340 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 298c7f6ac..e8a06be33 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -870,7 +870,7 @@ static void ArrayRef (ExprDesc* Expr) ED_MakeConstAbsInt (&Subscript, 0); ElementType = Indirect (Expr->Type); } - + /* The element type has the combined qualifiers from itself and the array, * it is a member of (if any). */ @@ -1121,7 +1121,11 @@ static void StructRef (ExprDesc* Expr) Expr->IVal += Field->V.Offs; /* The type is the type of the field plus any qualifiers from the struct */ - Q = GetQualifier (Expr->Type); + if (IsClassStruct (Expr->Type)) { + Q = GetQualifier (Expr->Type); + } else { + Q = GetQualifier (Indirect (Expr->Type)); + } if (GetQualifier (Field->Type) == (GetQualifier (Field->Type) | Q)) { Expr->Type = Field->Type; } else {