mirror of https://github.com/cc65/cc65.git
Fixed potential errors with subtraction evaluation of identifiers at different memory locations.
This commit is contained in:
parent
5c3ff714ae
commit
23aa562094
|
@ -3272,7 +3272,7 @@ static void parsesub (ExprDesc* Expr)
|
||||||
/* The right hand side is constant. Check left hand side. */
|
/* The right hand side is constant. Check left hand side. */
|
||||||
if (ED_IsQuasiConst (Expr)) {
|
if (ED_IsQuasiConst (Expr)) {
|
||||||
/* We can't do all 'ptr1 - ptr2' constantly at the moment */
|
/* We can't do all 'ptr1 - ptr2' constantly at the moment */
|
||||||
if (Expr->Sym == Expr2.Sym) {
|
if (ED_GetLoc (Expr) == ED_GetLoc (&Expr2) && Expr->Sym == Expr2.Sym) {
|
||||||
Expr->IVal = (Expr->IVal - Expr2.IVal) / rscale;
|
Expr->IVal = (Expr->IVal - Expr2.IVal) / rscale;
|
||||||
/* Get rid of unneeded flags etc. */
|
/* Get rid of unneeded flags etc. */
|
||||||
ED_MakeConstAbsInt (Expr, Expr->IVal);
|
ED_MakeConstAbsInt (Expr, Expr->IVal);
|
||||||
|
|
Loading…
Reference in New Issue