From 9bea88d61611dc12eeb211e342461f9157177464 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Mon, 10 Jul 2017 22:25:11 +0200 Subject: 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). --- tccgen.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tccgen.c') 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); -- cgit v1.3.1