1
0
mirror of https://github.com/cc65/cc65.git synced 2025-02-09 17:33:00 +00:00

Merge pull request #2592 from kugelfuhr/kugelfuhr/fix-2566

Fix a field alignment bug
This commit is contained in:
Bob Andrews 2025-01-05 19:25:51 +01:00 committed by GitHub
commit 86ed0722e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 1 deletions

View File

@ -104,10 +104,16 @@ static void CopyStruct (ExprDesc* LExpr, ExprDesc* RExpr)
} else {
/* The rhs cannot happen to be loaded in the primary as it is too big */
/* Load the address of rhs into the primary */
if (!ED_IsLocExpr (RExpr)) {
ED_AddrExpr (RExpr);
LoadExpr (CF_NONE, RExpr);
} else if (RExpr->IVal != 0) {
/* We have an expression in the primary plus a constant
** offset. Adjust the value in the primary accordingly.
*/
g_inc (CF_PTR | CF_CONST, RExpr->IVal);
RExpr->IVal = 0;
}
/* Push the address of the rhs as the source of memcpy */