Merge pull request #2070 from bbbradsmith/fix2060

RHS primary integer promotion must happen after loading the primary, not before
This commit is contained in:
Bob Andrews
2023-05-03 23:57:19 +02:00
committed by GitHub
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;