aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/decl.c
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2020-06-29 23:20:16 +0200
committerHarald Anlauf <anlauf@gmx.de>2020-06-29 23:20:53 +0200
commit583812c2e2f3593823622b0a5821d957c832dbd0 (patch)
tree1c87687cfe33bf7bf8b0d4508638dfad0d738f96 /gcc/fortran/decl.c
parent95cdcf701dad826f225d6413b59650f181954399 (diff)
downloadgcc-583812c2e2f3593823622b0a5821d957c832dbd0.zip
gcc-583812c2e2f3593823622b0a5821d957c832dbd0.tar.gz
gcc-583812c2e2f3593823622b0a5821d957c832dbd0.tar.bz2
PR fortran/95978 - ICE in gfc_match_data, at fortran/decl.c:731
Catch NULL pointer dereference on invalid DATA statement. gcc/fortran/ PR fortran/95978 * decl.c (gfc_match_data): Avoid NULL pointer dereference.
Diffstat (limited to 'gcc/fortran/decl.c')
-rw-r--r--gcc/fortran/decl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/decl.c b/gcc/fortran/decl.c
index ac1f63f..f38def4 100644
--- a/gcc/fortran/decl.c
+++ b/gcc/fortran/decl.c
@@ -728,7 +728,7 @@ gfc_match_data (void)
gfc_constructor *c;
c = gfc_constructor_first (new_data->value->expr->value.constructor);
for (; c; c = gfc_constructor_next (c))
- if (c->expr->ts.type == BT_BOZ)
+ if (c->expr && c->expr->ts.type == BT_BOZ)
{
gfc_error ("BOZ literal constant at %L cannot appear in a "
"structure constructor", &c->expr->where);