Fixed a bug that pointer subtraction results from two absolute addresses are calculated as unsigned long.

This commit is contained in:
acqn
2021-02-07 11:35:36 +08:00
committed by greg-king5
parent da4cc08b78
commit f1c715c455
2 changed files with 7 additions and 1 deletions

View File

@@ -3353,7 +3353,7 @@ static void parsesub (ExprDesc* Expr)
Error ("Incompatible pointer types");
} else {
Expr->IVal = (Expr->IVal - Expr2.IVal) /
CheckedPSizeOf (lhst);
(long)CheckedPSizeOf (lhst);
}
/* Operate on pointers, result type is an integer */
Expr->Type = type_int;