From: Jerry DeLisle Date: Fri, 28 Mar 2008 04:44:40 +0000 (+0000) Subject: re PR fortran/35724 (Compile time segmentation fault for CSHIFT with negative third... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=97d650ccf79a0bbf45387ae0cc77f98d345dca6a;p=gcc.git re PR fortran/35724 (Compile time segmentation fault for CSHIFT with negative third arg) 2008-03-27 Jerry DeLisle PR fortran/35724 * iresolve.c (gfc_resolve_cshift): Check for NULL symtree in test for optional argument attribute. From-SVN: r133668 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 67dc49b7da8..670c5b8a340 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2008-03-27 Jerry DeLisle + + PR fortran/35724 + * iresolve.c (gfc_resolve_cshift): Check for NULL symtree in test for + optional argument attribute. + 2008-03-27 Tom Tromey * Make-lang.in: Revert automatic dependency patch. diff --git a/gcc/fortran/iresolve.c b/gcc/fortran/iresolve.c index bdb6928c4a5..c166d8f2d60 100644 --- a/gcc/fortran/iresolve.c +++ b/gcc/fortran/iresolve.c @@ -597,7 +597,8 @@ gfc_resolve_cshift (gfc_expr *f, gfc_expr *array, gfc_expr *shift, if (dim != NULL) { - if (dim->expr_type != EXPR_CONSTANT && dim->symtree->n.sym->attr.optional) + if (dim->expr_type != EXPR_CONSTANT && dim->symtree != NULL + && dim->symtree->n.sym->attr.optional) { /* Mark this for later setting the type in gfc_conv_missing_dummy. */ dim->representation.length = shift->ts.kind;