RHS primary integer promotion must happen after loading the primary, not before. See: #2060

This commit is contained in:
bbbradsmith
2023-05-02 14:42:00 -04:00
parent 805e98a7aa
commit 1c26b1cf1b
2 changed files with 58 additions and 1 deletions

View File

@@ -3090,9 +3090,10 @@ static void parseadd (ExprDesc* Expr, int DoArrayRef)
Expr->Type = Expr2.Type;
} else if (!DoArrayRef && IsClassInt (lhst) && IsClassInt (rhst)) {
/* Integer addition */
flags = typeadjust (Expr, &Expr2, 0);
/* Load rhs into the primary */
LoadExpr (CF_NONE, &Expr2);
/* Adjust rhs primary if needed */
flags = typeadjust (Expr, &Expr2, 0);
} else {
/* OOPS */
AddDone = -1;