]> git.ipfire.org Git - thirdparty/gcc.git/commit
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>
Thu, 23 Jul 2020 20:07:42 +0000 (22:07 +0200)
commit76a8ff3948ad5a36ccae7305a2e9a7c2499418e5
treea9b283154f64d2620206bda5e937c8b428b58e2a
parenta3980ada1bd99cf8df22284862693088e5d1ca7c
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.

(cherry picked from commit 70c884a4b82733027ac0e2620d09169b177080d7)
gcc/fortran/class.c
gcc/fortran/primary.c
gcc/fortran/resolve.c
gcc/testsuite/gfortran.dg/pr95980_2.f90 [new file with mode: 0644]