aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2012-09-05 18:40:48 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2012-09-05 18:40:48 +0200
commit04529aba93eae54302ff3f76fc3af987bc28df2e (patch)
tree0fc1433d2835bbd24d3f009f254ae58ed1495821 /gcc/fortran
parent7e7d75c136783cb9e4270578654e02fcfcd3917f (diff)
downloadgcc-04529aba93eae54302ff3f76fc3af987bc28df2e.zip
gcc-04529aba93eae54302ff3f76fc3af987bc28df2e.tar.gz
gcc-04529aba93eae54302ff3f76fc3af987bc28df2e.tar.bz2
re PR fortran/54462 (Another "segmentation fault" after an error in COMMON statement after r190853)
2012-09-05 Tobias Burnus <burnus@net-b.de> PR fortran/54462 * symbol.c (gfc_undo_symbols): Avoid NULL pointer dereference. From-SVN: r190989
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/symbol.c10
2 files changed, 11 insertions, 4 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index dbafc44..69c0fe8 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2012-09-05 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/54462
+ * symbol.c (gfc_undo_symbols): Avoid NULL pointer dereference.
+
2012-09-04 Janus Weil <janus@gcc.gnu.org>
PR fortran/54435
diff --git a/gcc/fortran/symbol.c b/gcc/fortran/symbol.c
index 8d3b56c..1f4a735 100644
--- a/gcc/fortran/symbol.c
+++ b/gcc/fortran/symbol.c
@@ -2919,10 +2919,12 @@ gfc_undo_symbols (void)
gfc_symtree st, *st0;
st0 = find_common_symtree (p->ns->common_root,
p->common_block);
-
- st.name = st0->name;
- gfc_delete_bbt (&p->ns->common_root, &st, compare_symtree);
- free (st0);
+ if (st0)
+ {
+ st.name = st0->name;
+ gfc_delete_bbt (&p->ns->common_root, &st, compare_symtree);
+ free (st0);
+ }
}
if (p->common_block->head == p)