1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 02:29:52 +00:00

Fixed a problem similar to the one in Assignment() some time ago: An

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
This commit is contained in:
uz 2009-09-08 20:08:21 +00:00
parent 84e288f21c
commit 2d3b0f1146

View File

@ -1721,7 +1721,14 @@ static void hie_internal (const GenDesc* Ops, /* List of generators */
}
/* 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)) {