diff options
| author | Michael Matz <matz@suse.de> | 2017-07-10 22:25:11 +0200 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2017-07-10 22:25:11 +0200 |
| commit | 9bea88d61611dc12eeb211e342461f9157177464 (patch) | |
| tree | d8a3c666fce163dd132c7bf01e6c13c1396676c4 /tccgen.c | |
| parent | 2240422da9b55b71cfb32220bb0246ec92bfc432 (diff) | |
| download | tinycc-9bea88d61611dc12eeb211e342461f9157177464.tar.gz tinycc-9bea88d61611dc12eeb211e342461f9157177464.tar.bz2 | |
Fix statement exprs returning a local label
Like returned local variables also labels local to a statement expression
can be returned, and so their symbols must not be immediately freed
(though they need to be removed from the symbol table).
Diffstat (limited to 'tccgen.c')
| -rw-r--r-- | tccgen.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -5861,7 +5861,7 @@ static void block(int *bsym, int *csym, int is_expr) } } /* pop locally defined labels */ - label_pop(&local_label_stack, llabel); + label_pop(&local_label_stack, llabel, is_expr); /* pop locally defined symbols */ --local_scope; /* In the is_expr case (a statement expression is finished here), @@ -6948,7 +6948,7 @@ static void gen_function(Sym *sym) gsym(rsym); gfunc_epilog(); cur_text_section->data_offset = ind; - label_pop(&global_label_stack, NULL); + label_pop(&global_label_stack, NULL, 0); /* reset local stack */ local_scope = 0; sym_pop(&local_stack, NULL, 0); |
