mirror of
https://github.com/mirror/tinycc.git
synced 2026-08-22 11:23:27 +08:00
Fix interaction of (local) labels and stmt exprs
as per testcase. We must not reset token.sym_label twice with kept symbols. This is no problem for non-label symbols because those aren't generated on demand when mentioning them.
This commit is contained in:
5
tccpp.c
5
tccpp.c
@@ -1402,9 +1402,12 @@ ST_FUNC void label_pop(Sym **ptop, Sym *slast, int keep)
|
||||
}
|
||||
}
|
||||
/* remove label */
|
||||
table_ident[s->v - TOK_IDENT]->sym_label = s->prev_tok;
|
||||
if (s->r != LABEL_GONE)
|
||||
table_ident[s->v - TOK_IDENT]->sym_label = s->prev_tok;
|
||||
if (!keep)
|
||||
sym_free(s);
|
||||
else
|
||||
s->r = LABEL_GONE;
|
||||
}
|
||||
if (!keep)
|
||||
*ptop = slast;
|
||||
|
||||
Reference in New Issue
Block a user