re PR fortran/35724 (Compile time segmentation fault for CSHIFT with negative third...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 28 Mar 2008 04:44:40 +0000 (04:44 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Fri, 28 Mar 2008 04:44:40 +0000 (04:44 +0000)
2008-03-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR fortran/35724
* iresolve.c (gfc_resolve_cshift): Check for NULL symtree in test for
optional argument attribute.

From-SVN: r133668

gcc/fortran/ChangeLog
gcc/fortran/iresolve.c

index 67dc49b7da8e1b3d12fb85af68889a5b34041269..670c5b8a340ada8f07087279a8424a6a5b0fa9b8 100644 (file)
@@ -1,3 +1,9 @@
+2008-03-27  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/35724
+       * iresolve.c (gfc_resolve_cshift): Check for NULL symtree in test for
+       optional argument attribute.
+
 2008-03-27  Tom Tromey  <tromey@redhat.com>
 
        * Make-lang.in: Revert automatic dependency patch.
index bdb6928c4a5d882f3811fef12cf45a331ba59a85..c166d8f2d603bc9077acbbab37ebe49a2a439b6e 100644 (file)
@@ -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;