aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2018-01-18 07:54:17 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2018-01-18 07:54:17 +0000
commitfcf7923742d34c0cb7270594d4cdab4ea1199672 (patch)
treeca20843180e214fa4753562588c090a5efbf2c67 /gcc/fortran/expr.c
parent3c1f3bf69dce25e86a5302d7767c6fc4c2ce418b (diff)
downloadgcc-fcf7923742d34c0cb7270594d4cdab4ea1199672.zip
gcc-fcf7923742d34c0cb7270594d4cdab4ea1199672.tar.gz
gcc-fcf7923742d34c0cb7270594d4cdab4ea1199672.tar.bz2
re PR fortran/83864 (ICE in gfc_apply_init, at fortran/expr.c:4271)
2018-01-17 Harald Anlauf <anlauf@gmx.de> PR fortran/83864 * expr.c (add_init_expr_to_sym): Do not dereference NULL pointer. 2018-01-17 Harald Anlauf <anlauf@gmx.de> PR fortran/83864 * gfortran.dg/pr83864.f90: New test. From-SVN: r256837
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 45ccc18..936b6b6 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -4267,7 +4267,7 @@ gfc_apply_init (gfc_typespec *ts, symbol_attribute *attr, gfc_expr *init)
gfc_set_constant_character_len (len, init, -1);
else if (init
&& init->ts.type == BT_CHARACTER
- && init->ts.u.cl
+ && init->ts.u.cl && init->ts.u.cl->length
&& mpz_cmp (ts->u.cl->length->value.integer,
init->ts.u.cl->length->value.integer))
{