diff options
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 21 |
1 files changed, 20 insertions, 1 deletions
@@ -4286,6 +4286,25 @@ static int is_label(void) } } +static void label_or_decl(int l) +{ + int last_tok; + + /* fast test first */ + if (tok >= TOK_UIDENT) + { + /* no need to save tokc because tok is an identifier */ + last_tok = tok; + next(); + if (tok == ':') { + unget_tok(last_tok); + return; + } + unget_tok(last_tok); + } + decl(l); +} + static void block(int *bsym, int *csym, int *case_sym, int *def_sym, int case_reg, int is_expr) { @@ -4359,7 +4378,7 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, } } while (tok != '}') { - decl(VT_LOCAL); + label_or_decl(VT_LOCAL); if (tok != '}') { if (is_expr) vpop(); |
