Fortran: fix ICE in check_host_association [PR108544]
authorHarald Anlauf <anlauf@gmx.de>
Wed, 25 Jan 2023 21:47:26 +0000 (22:47 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 26 Jan 2023 18:25:44 +0000 (19:25 +0100)
commitc8e07c7951421e718bcafbe5924e75c9aa133af9
tree6e9bd75320a3131c383ee6a973b3f29d3a98c765
parenta82ce9c8d155ecda2d1c647d5c588f29e21ef4a3
Fortran: fix ICE in check_host_association [PR108544]

gcc/fortran/ChangeLog:

PR fortran/108544
* resolve.cc (check_host_association): Extend host association check
so that it is not restricted to functions.  Also prevent NULL pointer
dereference.

gcc/testsuite/ChangeLog:

PR fortran/108544
* gfortran.dg/pr108544.f90: New test.
* gfortran.dg/pr96102b.f90: New test.
gcc/fortran/resolve.cc
gcc/testsuite/gfortran.dg/pr108544.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pr96102b.f90 [new file with mode: 0644]