1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-24 11:31:31 +00:00

Fixed '[]', '()' '.' and '->' operators following a postfix increment/decrement.

This commit is contained in:
acqn 2021-05-16 16:09:45 +08:00 committed by Oliver Schmidt
parent 43ca887263
commit 1450f146a5

View File

@ -80,6 +80,8 @@ static GenDesc GenOASGN = { TOK_OR_ASSIGN, GEN_NOPUSH, g_or };
static void parseadd (ExprDesc* Expr, int DoArrayRef);
static void PostInc (ExprDesc* Expr);
static void PostDec (ExprDesc* Expr);
@ -88,6 +90,7 @@ static void parseadd (ExprDesc* Expr, int DoArrayRef);
/*****************************************************************************/
static unsigned GlobalModeFlags (const ExprDesc* Expr)
/* Return the addressing mode flags for the given expression */
{
@ -1510,7 +1513,8 @@ static void hie11 (ExprDesc *Expr)
Primary (Expr);
/* Check for a rhs */
while (CurTok.Tok == TOK_LBRACK || CurTok.Tok == TOK_LPAREN ||
while (CurTok.Tok == TOK_INC || CurTok.Tok == TOK_DEC ||
CurTok.Tok == TOK_LBRACK || CurTok.Tok == TOK_LPAREN ||
CurTok.Tok == TOK_DOT || CurTok.Tok == TOK_PTR_REF) {
switch (CurTok.Tok) {
@ -1554,6 +1558,14 @@ static void hie11 (ExprDesc *Expr)
StructRef (Expr);
break;
case TOK_INC:
PostInc (Expr);
break;
case TOK_DEC:
PostDec (Expr);
break;
default:
Internal ("Invalid token in hie11: %d", CurTok.Tok);
@ -2106,13 +2118,6 @@ void hie10 (ExprDesc* Expr)
/* An expression */
hie11 (Expr);
/* Handle post increment */
switch (CurTok.Tok) {
case TOK_INC: PostInc (Expr); break;
case TOK_DEC: PostDec (Expr); break;
default: break;
}
}
break;
}