Fixed integer promotion of unary operations.
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user