mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
Fixed integer promotion of unary operations.
This commit is contained in:
parent
8d225c32b1
commit
bb9c203222
@ -1856,8 +1856,8 @@ static void UnaryOp (ExprDesc* Expr)
|
|||||||
/* Value is not constant */
|
/* Value is not constant */
|
||||||
LoadExpr (CF_NONE, Expr);
|
LoadExpr (CF_NONE, Expr);
|
||||||
|
|
||||||
/* Get the type of the expression */
|
/* Adjust the type of the value */
|
||||||
Flags = TypeOf (Expr->Type);
|
Flags = g_typeadjust (TypeOf (Expr->Type), TypeOf (type_int) | CF_CONST);
|
||||||
|
|
||||||
/* Handle the operation */
|
/* Handle the operation */
|
||||||
switch (Tok) {
|
switch (Tok) {
|
||||||
@ -1870,6 +1870,9 @@ static void UnaryOp (ExprDesc* Expr)
|
|||||||
/* The result is an rvalue in the primary */
|
/* The result is an rvalue in the primary */
|
||||||
ED_FinalizeRValLoad (Expr);
|
ED_FinalizeRValLoad (Expr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Adjust the type of the expression */
|
||||||
|
Expr->Type = IntPromotion (Expr->Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user