aboutsummaryrefslogtreecommitdiff
path: root/tccgen.c
diff options
context:
space:
mode:
authorMichael Matz <matz@suse.de>2017-07-10 22:25:11 +0200
committerMichael Matz <matz@suse.de>2017-07-10 22:25:11 +0200
commit9bea88d61611dc12eeb211e342461f9157177464 (patch)
treed8a3c666fce163dd132c7bf01e6c13c1396676c4 /tccgen.c
parent2240422da9b55b71cfb32220bb0246ec92bfc432 (diff)
downloadtinycc-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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tccgen.c b/tccgen.c
index c3185ca..f733598 100644
--- a/tccgen.c
+++ b/tccgen.c
@@ -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);