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
43424342 gsym_addr(b, d);
43434343 } else if (tok == '{') {
43444344 Sym *llabel;
4345+ SValue *pvtop;
43454346
43464347 next();
43474348 /* record local declaration stack position */
43484349 s = local_stack;
43494350 llabel = local_label_stack;
4351+ /* record vstack position */
4352+ pvtop = vtop;
43504353 /* handle local labels declarations */
43514354 if (tok == TOK_LABEL) {
43524355 next();
@@ -4373,6 +4376,8 @@ static void block(int *bsym, int *csym, int *case_sym, int *def_sym, · 20 unmodified lines
43734376 }
43744377 /* pop locally defined labels */
43754378 label_pop(&local_label_stack, llabel);
4379+ /* pop left-over VLA size expressions */
4380+ vtop = pvtop;
43764381 /* pop locally defined symbols */
43774382 if(is_expr) {
43784383 /* 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