diff options
| author | Erik Edelmann <eedelman@gcc.gnu.org> | 2006-01-27 17:05:21 +0000 |
|---|---|---|
| committer | Erik Edelmann <eedelman@gcc.gnu.org> | 2006-01-27 17:05:21 +0000 |
| commit | 091c9413bb5e21d619ff38e5a5dcea2e78e0ae42 (patch) | |
| tree | 4f22a102c13e2eac8890d0ed4906fb9043ae2ccd /gcc/fortran/symbol.c | |
| parent | 929e5e5b5d1dcc5de28ab486605c889dc879ab20 (diff) | |
| download | gcc-091c9413bb5e21d619ff38e5a5dcea2e78e0ae42.zip gcc-091c9413bb5e21d619ff38e5a5dcea2e78e0ae42.tar.gz gcc-091c9413bb5e21d619ff38e5a5dcea2e78e0ae42.tar.bz2 | |
symbol.c (free_old_symbol): Fix confusing comment, and add code to free old_symbol->formal.
fortran/
2005-01-27 Erik Edelmann <eedelman@gcc.gnu.org>
* symbol.c (free_old_symbol): Fix confusing comment, and add code
to free old_symbol->formal.
From-SVN: r110301
Diffstat (limited to 'gcc/fortran/symbol.c')
| -rw-r--r-- | gcc/fortran/symbol.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 33af725..111c692 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2230,8 +2230,11 @@ gfc_undo_symbols (void) } -/* Free sym->old_symbol. sym->old_symbol is mostly a shallow copy of sym; but - few components might have been given new values. */ +/* Free sym->old_symbol. sym->old_symbol is mostly a shallow copy of sym; the + components of old_symbol that might need deallocation are the "allocatables" + that are restored in gfc_undo_symbols(), with two exceptions: namelist and + namelist_tail. In case these differ between old_symbol and sym, it's just + because sym->namelist has gotten a few more items. */ static void free_old_symbol (gfc_symbol * sym) @@ -2245,6 +2248,9 @@ free_old_symbol (gfc_symbol * sym) if (sym->old_symbol->value != sym->value) gfc_free_expr (sym->old_symbol->value); + if (sym->old_symbol->formal != sym->formal) + gfc_free_formal_arglist (sym->old_symbol->formal); + gfc_free (sym->old_symbol); sym->old_symbol = NULL; } |
