diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 6fb2d5e27..a880dbdbe 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -2929,8 +2929,8 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *Expr) } /* Setup the code generator flags */ - lflags |= TypeOf (Expr->Type) | GlobalModeFlags (Expr) | CF_FORCECHAR; - rflags |= TypeOf (Expr2.Type); + lflags |= TypeOf (Expr->Type) | GlobalModeFlags (Expr); + rflags |= TypeOf (Expr2.Type) | CF_FORCECHAR; /* Convert the type of the lhs to that of the rhs */ g_typecast (lflags, rflags); diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index 57313457d..86c07ec88 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -102,7 +102,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType) LoadExpr (CF_NONE, Expr); /* Emit typecast code */ - g_typecast (TypeOf (NewType), TypeOf (OldType)); + g_typecast (TypeOf (NewType), TypeOf (OldType) | CF_FORCECHAR); /* Value is now in primary and an rvalue */ ED_MakeRValExpr (Expr); @@ -148,7 +148,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType) LoadExpr (CF_NONE, Expr); /* Emit typecast code. */ - g_typecast (TypeOf (NewType) | CF_FORCECHAR, TypeOf (OldType)); + g_typecast (TypeOf (NewType), TypeOf (OldType) | CF_FORCECHAR); /* Value is now a rvalue in the primary */ ED_MakeRValExpr (Expr);