1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 19:29:37 +00:00

Fixed ICE on error cases such as '&func + int a'.

This commit is contained in:
acqn 2021-03-29 14:30:44 +08:00 committed by Oliver Schmidt
parent 200b420562
commit 91fd30611a

View File

@ -2850,8 +2850,11 @@ static void parseadd (ExprDesc* Expr, int DoArrayRef)
} else {
/* OOPS */
AddDone = -1;
/* Avoid further errors */
ED_MakeConstAbsInt (Expr, 0);
}
if (!AddDone) {
/* Do constant calculation if we can */
if (ED_IsAbs (&Expr2) &&
(ED_IsAbs (Expr) || lscale == 1)) {
@ -2872,6 +2875,7 @@ static void parseadd (ExprDesc* Expr, int DoArrayRef)
*Expr = Expr2;
AddDone = 1;
}
}
if (AddDone) {
/* Adjust the result for addition */