From 8132af9db3e2bf5a4f39cb48b6e3fd8f4045ec9f Mon Sep 17 00:00:00 2001 From: "Steven G. Kargl" Date: Fri, 11 May 2018 18:58:21 +0000 Subject: re PR fortran/85542 (ICE in check_inquiry, at fortran/expr.c:2426) 2018-05-11 Steven G. Kargl PR fortran/85542 * expr.c (check_inquiry): Avoid NULL pointer dereference. 2018-05-11 Steven G. Kargl PR fortran/85542 * gfortran.dg/pr85542.f90: New test. From-SVN: r260182 --- gcc/fortran/ChangeLog | 5 +++++ gcc/fortran/expr.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'gcc/fortran') diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 03dbc62..e603fef 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2018-05-11 Steven G. Kargl + + PR fortran/85542 + * expr.c (check_inquiry): Avoid NULL pointer dereference. + 2018-05-10 Steven G. Kargl PR fortran/85687 diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 9e113d2..e6ab822 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2422,7 +2422,7 @@ check_inquiry (gfc_expr *e, int not_restricted) /* Assumed character length will not reduce to a constant expression with LEN, as required by the standard. */ - if (i == 5 && not_restricted + if (i == 5 && not_restricted && ap->expr->symtree && ap->expr->symtree->n.sym->ts.type == BT_CHARACTER && (ap->expr->symtree->n.sym->ts.u.cl->length == NULL || ap->expr->symtree->n.sym->ts.deferred)) -- cgit v1.1