Fixed '[]', '()' '.' and '->' operators following a postfix increment/decrement.
This commit is contained in:
@@ -80,6 +80,8 @@ static GenDesc GenOASGN = { TOK_OR_ASSIGN, GEN_NOPUSH, g_or };
|
|||||||
|
|
||||||
|
|
||||||
static void parseadd (ExprDesc* Expr, int DoArrayRef);
|
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)
|
static unsigned GlobalModeFlags (const ExprDesc* Expr)
|
||||||
/* Return the addressing mode flags for the given expression */
|
/* Return the addressing mode flags for the given expression */
|
||||||
{
|
{
|
||||||
@@ -1510,7 +1513,8 @@ static void hie11 (ExprDesc *Expr)
|
|||||||
Primary (Expr);
|
Primary (Expr);
|
||||||
|
|
||||||
/* Check for a rhs */
|
/* 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) {
|
CurTok.Tok == TOK_DOT || CurTok.Tok == TOK_PTR_REF) {
|
||||||
|
|
||||||
switch (CurTok.Tok) {
|
switch (CurTok.Tok) {
|
||||||
@@ -1554,6 +1558,14 @@ static void hie11 (ExprDesc *Expr)
|
|||||||
StructRef (Expr);
|
StructRef (Expr);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case TOK_INC:
|
||||||
|
PostInc (Expr);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TOK_DEC:
|
||||||
|
PostDec (Expr);
|
||||||
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Internal ("Invalid token in hie11: %d", CurTok.Tok);
|
Internal ("Invalid token in hie11: %d", CurTok.Tok);
|
||||||
|
|
||||||
@@ -2106,13 +2118,6 @@ void hie10 (ExprDesc* Expr)
|
|||||||
/* An expression */
|
/* An expression */
|
||||||
hie11 (Expr);
|
hie11 (Expr);
|
||||||
|
|
||||||
/* Handle post increment */
|
|
||||||
switch (CurTok.Tok) {
|
|
||||||
case TOK_INC: PostInc (Expr); break;
|
|
||||||
case TOK_DEC: PostDec (Expr); break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user