1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-26 05:29:30 +00:00

Fixed/worked around a bug

git-svn-id: svn://svn.cc65.org/cc65/trunk@1343 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2002-07-10 21:04:02 +00:00
parent 63123a3566
commit f93eb903ba

View File

@ -240,21 +240,21 @@ unsigned assignadjust (type* lhst, ExprDesc* rhs)
* - the lhs pointer is a void pointer.
*/
if (!IsTypeVoid (Indirect (lhst)) && !IsTypeVoid (Indirect (rhst))) {
/* Compare the types */
switch (TypeCmp (lhst, rhst)) {
/* Compare the types */
switch (TypeCmp (lhst, rhst)) {
case TC_INCOMPATIBLE:
Error ("Incompatible pointer types");
break;
case TC_INCOMPATIBLE:
Error ("Incompatible pointer types");
break;
case TC_QUAL_DIFF:
Error ("Pointer types differ in type qualifiers");
break;
case TC_QUAL_DIFF:
Error ("Pointer types differ in type qualifiers");
break;
default:
/* Ok */
break;
}
default:
/* Ok */
break;
}
}
} else if (IsClassInt (rhst)) {
/* Int to pointer assignment is valid only for constant zero */
@ -279,7 +279,7 @@ unsigned assignadjust (type* lhst, ExprDesc* rhs)
return CF_INT;
}
void DefineData (ExprDesc* Expr)
/* Output a data definition for the given expression */
@ -2947,8 +2947,10 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *lval, int k)
lflags |= TypeOf (lval->Type) | CF_FORCECHAR;
rflags |= TypeOf (lval2.Type);
/* Adjust the rhs to the lhs */
g_typeadjust (lflags, rflags);
/* Adjust the rhs to the lhs. To avoid manipulation of the TOS, mark
* the lhs as const.
*/
g_typeadjust (lflags | CF_CONST, rflags);
/* Output apropriate code */
if (lval->Flags & E_MGLOBAL) {