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:
@@ -2929,8 +2929,8 @@ static void addsubeq (const GenDesc* Gen, ExprDesc *Expr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Setup the code generator flags */
|
/* Setup the code generator flags */
|
||||||
lflags |= TypeOf (Expr->Type) | GlobalModeFlags (Expr) | CF_FORCECHAR;
|
lflags |= TypeOf (Expr->Type) | GlobalModeFlags (Expr);
|
||||||
rflags |= TypeOf (Expr2.Type);
|
rflags |= TypeOf (Expr2.Type) | CF_FORCECHAR;
|
||||||
|
|
||||||
/* Convert the type of the lhs to that of the rhs */
|
/* Convert the type of the lhs to that of the rhs */
|
||||||
g_typecast (lflags, rflags);
|
g_typecast (lflags, rflags);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType)
|
|||||||
LoadExpr (CF_NONE, Expr);
|
LoadExpr (CF_NONE, Expr);
|
||||||
|
|
||||||
/* Emit typecast code */
|
/* 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 */
|
/* Value is now in primary and an rvalue */
|
||||||
ED_MakeRValExpr (Expr);
|
ED_MakeRValExpr (Expr);
|
||||||
@@ -148,7 +148,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType)
|
|||||||
LoadExpr (CF_NONE, Expr);
|
LoadExpr (CF_NONE, Expr);
|
||||||
|
|
||||||
/* Emit typecast code. */
|
/* 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 */
|
/* Value is now a rvalue in the primary */
|
||||||
ED_MakeRValExpr (Expr);
|
ED_MakeRValExpr (Expr);
|
||||||
|
|||||||
Reference in New Issue
Block a user