History

add naive workaround for VLA vstack leak

Joe Soroka committed 15 years ago

Commit b714af01 parent 6eb97c71 file · +5 −0Browse files

Unified · Split

tccgen.c+5−0
@@ -4342,11 +4342,14 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 4341 unmodified lines
4342 gsym_addr(b, d);4342 gsym_addr(b, d);
4343 } else if (tok == '{') {4343 } else if (tok == '{') {
4344 Sym *llabel;4344 Sym *llabel;
4345 SValue *pvtop;
4345 4346
4346 next();4347 next();
4347 /* record local declaration stack position */4348 /* record local declaration stack position */
4348 s = local_stack;4349 s = local_stack;
4349 llabel = local_label_stack;4350 llabel = local_label_stack;
4351 /* record vstack position */
4352 pvtop = vtop;
4350 /* handle local labels declarations */4353 /* handle local labels declarations */
4351 if (tok == TOK_LABEL) {4354 if (tok == TOK_LABEL) {
4352 next();4355 next();
@@ -4373,6 +4376,8 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 20 unmodified lines
4373 }4376 }
4374 /* pop locally defined labels */4377 /* pop locally defined labels */
4375 label_pop(&local_label_stack, llabel);4378 label_pop(&local_label_stack, llabel);
4379 /* pop left-over VLA size expressions */
4380 vtop = pvtop;
4376 /* pop locally defined symbols */4381 /* pop locally defined symbols */
4377 if(is_expr) {4382 if(is_expr) {
4378 /* XXX: this solution makes only valgrind happy...4383 /* XXX: this solution makes only valgrind happy...

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