match.c (gfc_match_allocate): Check for NULL pointer.
authorSteven G. Kargl <kargl@gcc.gnu.org>
Tue, 9 Jan 2018 01:17:50 +0000 (01:17 +0000)
committerSteven G. Kargl <kargl@gcc.gnu.org>
Tue, 9 Jan 2018 01:17:50 +0000 (01:17 +0000)
2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>

* match.c (gfc_match_allocate): Check for NULL pointer.

From-SVN: r256364

gcc/fortran/ChangeLog
gcc/fortran/match.c

index adb82609d9d4cb1701d27a5e6a77de1af47815cf..32586c509f938949f8e690c2986cb68cd8fac543 100644 (file)
@@ -1,3 +1,7 @@
+2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
+
+       * match.c (gfc_match_allocate): Check for NULL pointer.
+
 2018-01-08  Steven G. Kargl  <kargl@gcc.gnu.org>
 
        * expr.c (gfc_check_pointer_assign): Fix typo in comment.
index 5e313c41fcf6251b43dd21ddf89435805336a2fd..320a0d8af553de38fbff4f3cc1e0e1111ef51f14 100644 (file)
@@ -4071,7 +4071,7 @@ gfc_match_allocate (void)
         for which the corresponding type parameter is assumed.  */
       if (saw_assumed
          && (tail->expr->ts.deferred
-             || tail->expr->ts.u.cl->length
+             || (tail->expr->ts.u.cl && tail->expr->ts.u.cl->length)
              || tail->expr->symtree->n.sym->attr.dummy == 0))
        {
          gfc_error ("Incompatible allocate-object at %C for CHARACTER "