From f5dacda69b84b2a2f6c7df3b42021016af3df4f1 Mon Sep 17 00:00:00 2001 From: acqn Date: Sun, 16 May 2021 19:08:43 +0800 Subject: [PATCH] NoCodeConstExpr() fix to avoid exessive error messages. --- src/cc65/expr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 0275e61a3..cd1f780ea 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -4217,7 +4217,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 */