mirror of
https://github.com/mirror/tinycc.git
synced 2025-02-28 08:10:25 +08:00
add naive workaround for VLA vstack leak
This commit is contained in:
parent
6eb97c70b7
commit
b714af0405
5
tccgen.c
5
tccgen.c
@ -4342,11 +4342,14 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym,
|
||||
gsym_addr(b, d);
|
||||
} else if (tok == '{') {
|
||||
Sym *llabel;
|
||||
SValue *pvtop;
|
||||
|
||||
next();
|
||||
/* record local declaration stack position */
|
||||
s = local_stack;
|
||||
llabel = local_label_stack;
|
||||
/* record vstack position */
|
||||
pvtop = vtop;
|
||||
/* handle local labels declarations */
|
||||
if (tok == TOK_LABEL) {
|
||||
next();
|
||||
@ -4373,6 +4376,8 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym,
|
||||
}
|
||||
/* pop locally defined labels */
|
||||
label_pop(&local_label_stack, llabel);
|
||||
/* pop left-over VLA size expressions */
|
||||
vtop = pvtop;
|
||||
/* pop locally defined symbols */
|
||||
if(is_expr) {
|
||||
/* XXX: this solution makes only valgrind happy...
|
||||
|
Loading…
Reference in New Issue
Block a user