1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 07:29:33 +00:00

NoCodeConstExpr() fix to avoid exessive error messages.

This commit is contained in:
acqn 2021-05-16 19:08:43 +08:00 committed by mrdudz
parent 51d7c0f1eb
commit fcbb4a5246

View File

@ -4211,7 +4211,8 @@ ExprDesc NoCodeConstExpr (void (*Func) (ExprDesc*))
if (!ED_IsConst (&Expr) || !ED_CodeRangeIsEmpty (&Expr)) {
Error ("Constant expression expected");
/* To avoid any compiler errors, make the expression a valid const */
ED_MakeConstAbsInt (&Expr, 1);
Expr.Flags &= E_MASK_RTYPE | E_MASK_KEEP_RESULT;
Expr.Flags |= E_LOC_NONE;
}
/* Return by value */