1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

Fixed deferred post-inc and post-dec in unevaluated context such as 'sizeof(i++)'.

This commit is contained in:
acqn 2021-02-21 16:43:46 +08:00 committed by Oliver Schmidt
parent bb3a2db5a0
commit eadaf2fef8

View File

@ -376,6 +376,9 @@ void DoneDeferredOps (void)
static void DeferInc (const ExprDesc* Expr)
/* Defer the post-inc and put it in a queue */
{
if (ED_IsUneval (Expr)) {
return;
}
DeferredOp* Op = xmalloc (sizeof (DeferredOp));
memcpy (&Op->Expr, Expr, sizeof (ExprDesc));
Op->OpType = DOT_INC;
@ -387,6 +390,9 @@ static void DeferInc (const ExprDesc* Expr)
static void DeferDec (const ExprDesc* Expr)
/* Defer the post-dec and put it in a queue */
{
if (ED_IsUneval (Expr)) {
return;
}
DeferredOp* Op = xmalloc (sizeof (DeferredOp));
memcpy (&Op->Expr, Expr, sizeof (ExprDesc));
Op->OpType = DOT_DEC;