re PR fortran/35724 (Compile time segmentation fault for CSHIFT with negative third...
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 17 Apr 2008 04:30:04 +0000 (04:30 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Thu, 17 Apr 2008 04:30:04 +0000 (04:30 +0000)
2008-04-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

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

From-SVN: r134376

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

index 3e4dfa2e0d902315f48b400551aff5555b432fde..c8ec87acdb11525bf160d42b985bf277a77b3e6e 100644 (file)
@@ -1,3 +1,9 @@
+2008-04-16  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR fortran/35724
+       * iresolve.c (gfc_resolve_eoshift): Check for NULL symtree in test for
+       optional argument attribute.
+       
 2008-04-16  Paul Thomas  <pault@gcc.gnu.org>
 
        PR fortran/35932
index c166d8f2d603bc9077acbbab37ebe49a2a439b6e..2a3c6bd7283dcefb28ef136cda50fcd6601f85a3 100644 (file)
@@ -738,7 +738,8 @@ gfc_resolve_eoshift (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;