aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/match.c
diff options
context:
space:
mode:
authorSteven G. Kargl <kargl@gcc.gnu.org>2018-02-07 22:29:22 +0000
committerSteven G. Kargl <kargl@gcc.gnu.org>2018-02-07 22:29:22 +0000
commitb35a0ccd139f5df8262ef7ea5fed81d88074ecf8 (patch)
tree74651fb9a8d4adeb6578cf8c2e6704247010ee76 /gcc/fortran/match.c
parent72267602a7e46a578cf89cfc12782f8740b1cac5 (diff)
downloadgcc-b35a0ccd139f5df8262ef7ea5fed81d88074ecf8.zip
gcc-b35a0ccd139f5df8262ef7ea5fed81d88074ecf8.tar.gz
gcc-b35a0ccd139f5df8262ef7ea5fed81d88074ecf8.tar.bz2
re PR fortran/82994 (ICE in gfc_match_deallocate, at fortran/match.c:4478)
2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82994 * match.c (gfc_match_deallocate): Check for NULL pointer. 2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org> PR fortran/82994 * gfortran.dg/deallocate_error_3.f90: New test. * gfortran.dg/deallocate_error_4.f90: New test. From-SVN: r257465
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r--gcc/fortran/match.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c
index 7bce34b..9313f43 100644
--- a/gcc/fortran/match.c
+++ b/gcc/fortran/match.c
@@ -4632,8 +4632,8 @@ gfc_match_deallocate (void)
&& (tail->expr->ref->type == REF_COMPONENT
|| tail->expr->ref->type == REF_ARRAY));
if (sym && sym->ts.type == BT_CLASS)
- b2 = !(CLASS_DATA (sym)->attr.allocatable
- || CLASS_DATA (sym)->attr.class_pointer);
+ b2 = !(CLASS_DATA (sym) && (CLASS_DATA (sym)->attr.allocatable
+ || CLASS_DATA (sym)->attr.class_pointer));
else
b2 = sym && !(sym->attr.allocatable || sym->attr.pointer
|| sym->attr.proc_pointer);