aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorpault <>2005-11-10 22:24:28 +0000
committerpault <>2005-11-10 22:24:28 +0000
commit983f65bd932aefeb5b2eeac385f163eec11902a0 (patch)
treef8af7b25e393d0bdcc9c501354353285b3dd30cc /gcc/fortran/match.c
parent999ea526407bebd8e8415b182a8fb60fbe89b75b (diff)
2005-11-10 Paul Thomas <pault@gcc.gnu.org>simplify-dom-last-merge
PR fortran/24655 PR fortran/24755 * match.c (recursive_stmt_fcn): Add checks that symtree exists for the expression to weed out inline intrinsic functions and parameters. PR fortran/24409 * module.c (mio_symtree_ref): Correct the patch of 0923 so that a symbol is not substituted for by a the symbol for the module itself and to prevent the promotion of a formal argument. 2005-11-10 Paul Thomas <pault@gcc.gnu.org> PR fortran/24655 PR fortran/24755 * gfortran.dg/recursive_statement_functions.f90: Add statement functions using inline intrinsic functions and parameters to test that they no longer seg-fault. PR fortran/24409 gfortran.dg/nested_modules_4.f90: New test. gfortran.dg/nested_modules_5.f90: New test.
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 8725a5f0399..97e8f5a434f 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -2723,6 +2723,9 @@ recursive_stmt_fcn (gfc_expr *e, gfc_symbol *sym)
return true;
}
+ if (e->symtree == NULL)
+ return false;
+
/* Check the name before testing for nested recursion! */
if (sym->name == e->symtree->n.sym->name)
return true;
@@ -2736,7 +2739,7 @@ recursive_stmt_fcn (gfc_expr *e, gfc_symbol *sym)
break;
case EXPR_VARIABLE:
- if (sym->name == e->symtree->n.sym->name)
+ if (e->symtree && sym->name == e->symtree->n.sym->name)
return true;
break;