1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-27 15:29:46 +00:00

Fixed problems with casts, where larger values weren't truncated when casting

down to char size.


git-svn-id: svn://svn.cc65.org/cc65/trunk@3904 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2008-12-28 16:25:03 +00:00
parent a1fbb4fe32
commit 308ceeacf9
2 changed files with 4 additions and 4 deletions

View File

@ -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);

View File

@ -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);