]> gcc.gnu.org Git - gcc.git/commitdiff
re PR fortran/33375 (ICE (segfault) gfortran.dg/common_6.f90)
authorH.J. Lu <hongjiu.lu@intel.com>
Fri, 18 Jan 2008 01:29:11 +0000 (01:29 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Fri, 18 Jan 2008 01:29:11 +0000 (17:29 -0800)
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.

From-SVN: r131621

gcc/fortran/ChangeLog
gcc/fortran/gfortran.h
gcc/fortran/match.c
gcc/fortran/symbol.c

index ff0e63962a8412655fd05bb66e4b0364ede6115d..ad0ffcc443ee50acd120f9bfaeedb768ddb977bc 100644 (file)
@@ -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
index aac1f821334c0f184350c6cfa1d7e761eb3b01aa..d5f00737d3db4dba6e9b0692cddb0f6832fc20a4 100644 (file)
@@ -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);
index ad636f93f3d6709e8a25a65e4914251f2dce7589..f21748c1b9ae4cdd395a9a1a4b5fd952209c00c6 100644 (file)
@@ -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:
index 72008066990ccf4a00399b6f777816b971ef8112..a50ed261141c014a87adbf1d4d56be220d259697 100644 (file)
@@ -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)
     {
This page took 0.074223 seconds and 5 git commands to generate.