PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913
authorHarald Anlauf <anlauf@gmx.de>
Thu, 3 Dec 2020 19:33:22 +0000 (20:33 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 3 Dec 2020 19:33:22 +0000 (20:33 +0100)
commit30b606bb9b9314010a446ea4bed3481632008f75
tree0940049a5dfabfad17c3a8760ae0ec9b244c9b0b
parent656131e06aa76ba3cb50305c07cf5c8ee79fce44
PR fortran/95342 - ICE in gfc_match_subroutine, at fortran/decl.c:7913

Add checks for NULL pointers before dereferencing them.

gcc/fortran/ChangeLog:

PR fortran/95342
* decl.c (gfc_match_function_decl): Avoid NULL pointer dereference.
(gfc_match_subroutine): Likewise.

gcc/testsuite/ChangeLog:

PR fortran/95342
* gfortran.dg/pr95342.f90: New test.
gcc/fortran/decl.c
gcc/testsuite/gfortran.dg/pr95342.f90 [new file with mode: 0644]