diff options
| author | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-18 01:29:11 +0000 |
|---|---|---|
| committer | hjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-01-18 01:29:11 +0000 |
| commit | 922715fd70a4c052eeb69eff2a0a02b49610a2cf (patch) | |
| tree | 6618a99f503007bf9db19e45175332fb41f54b0e | |
| parent | eeaa887f60fb8137ce97644ce73ffa4884699b3a (diff) | |
| download | ppe42-gcc-922715fd70a4c052eeb69eff2a0a02b49610a2cf.tar.gz ppe42-gcc-922715fd70a4c052eeb69eff2a0a02b49610a2cf.zip | |
2008-01-17 H.J. Lu <hongjiu.lu@intel.com>
PR fortran/33375
* symbol.c (free_common_tree): Renamed to ...
(gfc_free_common_tree): This. Remove static.
(gfc_free_namespace): Updated.
* gfortran.h (gfc_free_common_tree): New.
* match.c (gfc_match_common): Call gfc_free_common_tree () with
gfc_current_ns->common_root and set gfc_current_ns->common_root
to NULL on syntax error.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@131621 138bc75d-0d04-0410-961f-82ee72b054a4
| -rw-r--r-- | gcc/fortran/ChangeLog | 13 | ||||
| -rw-r--r-- | gcc/fortran/gfortran.h | 1 | ||||
| -rw-r--r-- | gcc/fortran/match.c | 2 | ||||
| -rw-r--r-- | gcc/fortran/symbol.c | 10 |
4 files changed, 21 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index ff0e63962a8..ad0ffcc443e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,16 @@ +2008-01-17 H.J. Lu <hongjiu.lu@intel.com> + + PR fortran/33375 + * symbol.c (free_common_tree): Renamed to ... + (gfc_free_common_tree): This. Remove static. + (gfc_free_namespace): Updated. + + * gfortran.h (gfc_free_common_tree): New. + + * match.c (gfc_match_common): Call gfc_free_common_tree () with + gfc_current_ns->common_root and set gfc_current_ns->common_root + to NULL on syntax error. + 2008-01-18 Richard Sandiford <rsandifo@nildram.co.uk> PR fortran/34686 diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h index aac1f821334..d5f00737d3d 100644 --- a/gcc/fortran/gfortran.h +++ b/gcc/fortran/gfortran.h @@ -2137,6 +2137,7 @@ int gfc_symbols_could_alias (gfc_symbol *, gfc_symbol *); void gfc_undo_symbols (void); void gfc_commit_symbols (void); void gfc_commit_symbol (gfc_symbol *); +void gfc_free_common_tree (gfc_symtree *); void gfc_free_namespace (gfc_namespace *); void gfc_symbol_init_2 (void); diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index ad636f93f3d..f21748c1b9a 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -2951,6 +2951,8 @@ done: return MATCH_YES; syntax: + gfc_free_common_tree (gfc_current_ns->common_root); + gfc_current_ns->common_root = NULL; gfc_syntax_error (ST_COMMON); cleanup: diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c index 72008066990..a50ed261141 100644 --- a/gcc/fortran/symbol.c +++ b/gcc/fortran/symbol.c @@ -2726,14 +2726,14 @@ gfc_commit_symbol (gfc_symbol *sym) /* Recursive function that deletes an entire tree and all the common head structures it points to. */ -static void -free_common_tree (gfc_symtree * common_tree) +void +gfc_free_common_tree (gfc_symtree * common_tree) { if (common_tree == NULL) return; - free_common_tree (common_tree->left); - free_common_tree (common_tree->right); + gfc_free_common_tree (common_tree->left); + gfc_free_common_tree (common_tree->right); gfc_free (common_tree); } @@ -2863,7 +2863,7 @@ gfc_free_namespace (gfc_namespace *ns) free_sym_tree (ns->sym_root); free_uop_tree (ns->uop_root); - free_common_tree (ns->common_root); + gfc_free_common_tree (ns->common_root); for (cl = ns->cl_list; cl; cl = cl2) { |

