History

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.

Michael Matz committed 10 years ago

Commit b303a001 parent d4d31441 file · +1 −7Browse files

Unified · Split

tccgen.c+1−7
@@ -5418,7 +5418,7 @@ static void block(int *bsym, int *csym, int is_expr) · 5417 unmodified lines
54185418 gsym(a);
54195419 gsym_addr(b, d);
54205420 } else if (tok == '{') {
5421− Sym *llabel, *glabel;
5421+ Sym *llabel;
54225422 int block_vla_sp_loc = vla_sp_loc, saved_vlas_in_scope = vlas_in_scope;
54235423
54245424 next();
@@ -5426,10 +5426,6 @@ static void block(int *bsym, int *csym, int is_expr) · 1 unmodified line
54265426 s = local_stack;
54275427 llabel = local_label_stack;
54285428 ++local_scope;
5429− /* Labels defined inside statement expressions aren't
5430− available from the outside, so record that as well. */
5431− if (is_expr)
5432− glabel = global_label_stack;
54335429
54345430 /* handle local labels declarations */
54355431 if (tok == TOK_LABEL) {
@@ -5455,8 +5451,6 @@ static void block(int *bsym, int *csym, int is_expr) · 19 unmodified lines
54555451 block(bsym, csym, is_expr);
54565452 }
54575453 }
5458− if (is_expr)
5459− label_pop(&global_label_stack, glabel);
54605454 /* pop locally defined labels */
54615455 label_pop(&local_label_stack, llabel);
54625456 /* pop locally defined symbols */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t