Unified · Split
| @@ -6276,6 +6276,9 @@ static void block(int *bsym, Sym *bcl, int *csym, Sym *ccl, int is_expr) · 6275 unmodified lines | ||
| 6276 | 6276 | } else if (tok == TOK_FOR) { |
| 6277 | 6277 | int e; |
| 6278 | 6278 | int saved_nocode_wanted; |
| 6279 | + Sym *lcleanup = current_cleanups; | |
| 6280 | + int lncleanups = ncleanups; | |
| 6281 | + | |
| 6279 | 6282 | nocode_wanted &= ~0x20000000; |
| 6280 | 6283 | next(); |
| 6281 | 6284 | skip('('); |
| @@ -6317,6 +6320,9 @@ static void block(int *bsym, Sym *bcl, int *csym, Sym *ccl, int is_expr) · 35 unmodified lines | ||
| 6317 | 6320 | gsym(a); |
| 6318 | 6321 | gsym_addr(b, c); |
| 6319 | 6322 | --local_scope; |
| 6323 | + try_call_scope_cleanup(lcleanup); | |
| 6324 | + ncleanups = lncleanups; | |
| 6325 | + current_cleanups = lcleanup; | |
| 6320 | 6326 | sym_pop(&local_stack, s, 0); |
| 6321 | 6327 | |
| 6322 | 6328 | } else |