History

fix cleanup with for loop initialisation

matthias committed 7 years ago

Commit 14be3a11 parent 0d549461 file · +6 −0Browse files

Unified · Split

tccgen.c+6−0
@@ -6276,6 +6276,9 @@ static void block(int *bsym, Sym *bcl, int *csym, Sym *ccl, int is_expr) · 6275 unmodified lines
62766276 } else if (tok == TOK_FOR) {
62776277 int e;
62786278 int saved_nocode_wanted;
6279+ Sym *lcleanup = current_cleanups;
6280+ int lncleanups = ncleanups;
6281+
62796282 nocode_wanted &= ~0x20000000;
62806283 next();
62816284 skip('(');
@@ -6317,6 +6320,9 @@ static void block(int *bsym, Sym *bcl, int *csym, Sym *ccl, int is_expr) · 35 unmodified lines
63176320 gsym(a);
63186321 gsym_addr(b, c);
63196322 --local_scope;
6323+ try_call_scope_cleanup(lcleanup);
6324+ ncleanups = lncleanups;
6325+ current_cleanups = lcleanup;
63206326 sym_pop(&local_stack, s, 0);
63216327
63226328 } else

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