mirror of
https://github.com/cc65/cc65.git
synced 2025-01-11 11:30:13 +00:00
Merge pull request #1182 from acqn/StructPtrField
[cc65] Fixed testing 'struct->field'
This commit is contained in:
commit
83452ae6b3
@ -77,7 +77,7 @@ static int CopyStruct (ExprDesc* LExpr, ExprDesc* RExpr)
|
||||
/* Get the expression on the right of the '=' */
|
||||
hie1 (RExpr);
|
||||
|
||||
/* Check for equality of the structs */
|
||||
/* Check for equality of the structs/unions */
|
||||
if (TypeCmp (ltype, RExpr->Type) < TC_STRICT_COMPATIBLE) {
|
||||
TypeCompatibilityDiagnostic (ltype, RExpr->Type, 1,
|
||||
"Incompatible types in assignment to '%s' from '%s'");
|
||||
@ -114,6 +114,12 @@ static int CopyStruct (ExprDesc* LExpr, ExprDesc* RExpr)
|
||||
|
||||
/* Restore the indirection level of lhs */
|
||||
ED_IndExpr (LExpr);
|
||||
|
||||
/* Clear the tested flag set during loading. This is not neccessary
|
||||
** currently (and probably ever) as a struct/union cannot be converted
|
||||
** to a boolean in C, but there is no harm to be future-proof.
|
||||
*/
|
||||
ED_MarkAsUntested (LExpr);
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
@ -1301,6 +1301,9 @@ static void StructRef (ExprDesc* Expr)
|
||||
LoadExpr (CF_NONE, Expr);
|
||||
}
|
||||
|
||||
/* Clear the tested flag set during loading */
|
||||
ED_MarkAsUntested (Expr);
|
||||
|
||||
/* The type is the field type plus any qualifiers from the struct/union */
|
||||
if (IsClassStruct (Expr->Type)) {
|
||||
Q = GetQualifier (Expr->Type);
|
||||
|
Loading…
x
Reference in New Issue
Block a user