Revert "Reject jumping inside stmtexprs"
Not fully thought out. You can't jump inside stmt exprs, but you can jump out of them. So there's a difference between undefined but declared labels at the end of stmt exprs and those defined inside. Additionally it should also be checked if a label defined inside a stmt expr was tentatively created as declared from outside. I'm not prepared doing that right now, so simply revert. This reverts commit 9160e4cab9147d77840cc44a285031fdb4640cf9.
This commit is contained in:
parent
d4d3144e75
commit
b303a00ce0
1 changed files with 1 additions and 7 deletions
8
tccgen.c
8
tccgen.c
|
|
@ -5418,7 +5418,7 @@ static void block(int *bsym, int *csym, int is_expr)
|
||||||
gsym(a);
|
gsym(a);
|
||||||
gsym_addr(b, d);
|
gsym_addr(b, d);
|
||||||
} else if (tok == '{') {
|
} else if (tok == '{') {
|
||||||
Sym *llabel, *glabel;
|
Sym *llabel;
|
||||||
int block_vla_sp_loc = vla_sp_loc, saved_vlas_in_scope = vlas_in_scope;
|
int block_vla_sp_loc = vla_sp_loc, saved_vlas_in_scope = vlas_in_scope;
|
||||||
|
|
||||||
next();
|
next();
|
||||||
|
|
@ -5426,10 +5426,6 @@ static void block(int *bsym, int *csym, int is_expr)
|
||||||
s = local_stack;
|
s = local_stack;
|
||||||
llabel = local_label_stack;
|
llabel = local_label_stack;
|
||||||
++local_scope;
|
++local_scope;
|
||||||
/* Labels defined inside statement expressions aren't
|
|
||||||
available from the outside, so record that as well. */
|
|
||||||
if (is_expr)
|
|
||||||
glabel = global_label_stack;
|
|
||||||
|
|
||||||
/* handle local labels declarations */
|
/* handle local labels declarations */
|
||||||
if (tok == TOK_LABEL) {
|
if (tok == TOK_LABEL) {
|
||||||
|
|
@ -5455,8 +5451,6 @@ static void block(int *bsym, int *csym, int is_expr)
|
||||||
block(bsym, csym, is_expr);
|
block(bsym, csym, is_expr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_expr)
|
|
||||||
label_pop(&global_label_stack, glabel);
|
|
||||||
/* pop locally defined labels */
|
/* pop locally defined labels */
|
||||||
label_pop(&local_label_stack, llabel);
|
label_pop(&local_label_stack, llabel);
|
||||||
/* pop locally defined symbols */
|
/* pop locally defined symbols */
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue