expression that yields a constant value may have side effects, and the
expression code must not be removed in this case.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4137
b7a2c559-68d2-44c3-8de9-
860c34a00d81
}
/* Get the right hand side */
- rconst = (evalexpr (CF_NONE, hienext, &Expr2) == 0);
+ MarkedExprWithCheck (hienext, &Expr2);
+
+ /* Check for a constant expression */
+ rconst = (ED_IsConstAbs (&Expr2) && ED_CodeRangeIsEmpty (&Expr2));
+ if (!rconst) {
+ /* Not constant, load into the primary */
+ LoadExpr (CF_NONE, &Expr2);
+ }
/* Check the type of the rhs */
if (!IsClassInt (Expr2.Type)) {