Committed as obviously. 2018-06-13 Steven G. Kargl <ka...@gcc.gnu.org>
PR fortran/86110 * array.c (gfc_resolve_character_array_constructor): Avoid NULL pointer dereference. 2018-06-13 Steven G. Kargl <ka...@gcc.gnu.org> PR fortran/86110 * gfortran.dg/pr86110.f90: New test. -- Steve
Index: gcc/fortran/array.c =================================================================== --- gcc/fortran/array.c (revision 261521) +++ gcc/fortran/array.c (working copy) @@ -2040,7 +2040,9 @@ got_charlen: gfc_ref *ref; for (ref = p->expr->ref; ref; ref = ref->next) if (ref->type == REF_SUBSTRING + && ref->u.ss.start && ref->u.ss.start->expr_type == EXPR_CONSTANT + && ref->u.ss.end && ref->u.ss.end->expr_type == EXPR_CONSTANT) break; Index: gcc/testsuite/gfortran.dg/pr86110.f90 =================================================================== --- gcc/testsuite/gfortran.dg/pr86110.f90 (nonexistent) +++ gcc/testsuite/gfortran.dg/pr86110.f90 (working copy) @@ -0,0 +1,7 @@ +! { dg-do compile } +! PR fortran/86110 +program p + character(:), allocatable :: x, y + x = 'abc' + y = [x(:)] ! { dg-error "Incompatible ranks 0 and 1" } +end