1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

Fixed integer promotion of unary operations.

This commit is contained in:
acqn 2020-08-15 07:53:28 +08:00 committed by Oliver Schmidt
parent 8d225c32b1
commit bb9c203222

View File

@ -1856,8 +1856,8 @@ static void UnaryOp (ExprDesc* Expr)
/* Value is not constant */
LoadExpr (CF_NONE, Expr);
/* Get the type of the expression */
Flags = TypeOf (Expr->Type);
/* Adjust the type of the value */
Flags = g_typeadjust (TypeOf (Expr->Type), TypeOf (type_int) | CF_CONST);
/* Handle the operation */
switch (Tok) {
@ -1870,6 +1870,9 @@ static void UnaryOp (ExprDesc* Expr)
/* The result is an rvalue in the primary */
ED_FinalizeRValLoad (Expr);
}
/* Adjust the type of the expression */
Expr->Type = IntPromotion (Expr->Type);
}