PR fortran/95980 - ICE in get_unique_type_string, at fortran/class.c:485
authorHarald Anlauf <anlauf@gmx.de>
Fri, 10 Jul 2020 19:35:35 +0000 (21:35 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 10 Jul 2020 19:35:35 +0000 (21:35 +0200)
commit70c884a4b82733027ac0e2620d09169b177080d7
treefefa915f1be0e6bc5831048847ba1abb56d7eec5
parent8a0b69f0b089c05d233b8e1a941825b1ceac93bd
PR fortran/95980 - ICE in get_unique_type_string, at fortran/class.c:485

In SELECT TYPE, the argument may be an incorrectly specified unlimited
CLASS variable.  Avoid NULL pointer dereferences for clean error
recovery.

gcc/fortran/
PR fortran/95980
* class.c (gfc_add_component_ref, gfc_build_class_symbol):
Add checks for NULL pointer dereference.
* primary.c (gfc_variable_attr): Likewise.
* resolve.c (resolve_variable, resolve_assoc_var)
(resolve_fl_var_and_proc, resolve_fl_variable_derived)
(resolve_symbol): Likewise.
gcc/fortran/class.c
gcc/fortran/primary.c
gcc/fortran/resolve.c
gcc/testsuite/gfortran.dg/pr95980_2.f90 [new file with mode: 0644]