aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2020-05-26 23:29:52 +0200
committerHarald Anlauf <anlauf@gmx.de>2020-05-26 23:29:52 +0200
commit56f03cd12be26828788a27f6f3c250041a958e45 (patch)
tree5f19b44371d196d19da53912ad5c3c79832cbdcc /gcc
parent3bf5e7657b752cc2352778e8c20ac9cdddca4f93 (diff)
downloadgcc-56f03cd12be26828788a27f6f3c250041a958e45.zip
gcc-56f03cd12be26828788a27f6f3c250041a958e45.tar.gz
gcc-56f03cd12be26828788a27f6f3c250041a958e45.tar.bz2
PR fortran/95104 - Segfault on a legal WAIT statement
Referencing a unit in a WAIT statement that has not been opened before resulted in a NULL pointer dereference. Check for this condition. 2020-05-26 Harald Anlauf <anlauf@gmx.de> libgfortran/ PR libfortran/95104 * io/transfer.c (st_wait_async): Do not dereference NULL pointer. gcc/testsuite/ PR libfortran/95104 * gfortran.dg/pr95104.f90: New test. Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/gfortran.dg/pr95104.f908
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/testsuite/gfortran.dg/pr95104.f90 b/gcc/testsuite/gfortran.dg/pr95104.f90
new file mode 100644
index 0000000..20bdd91
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/pr95104.f90
@@ -0,0 +1,8 @@
+! { dg-do run }
+! PR libfortran/95104 - Segfault on a legal WAIT statement
+
+program test
+ wait (10, iostat=ios)
+ if (ios /= 0) stop 1
+ close (10)
+end program test