diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-12-30 22:10:13 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-12-30 22:10:13 +0000 |
commit | ce5458c277ba724e6558ba1b78161e70a4a73b76 (patch) | |
tree | 8ae75bef348e501781c5083ab2de1758658fe966 /gcc | |
parent | c2cb0f4b9abfb7f177ee454fdb0b6dce247626a3 (diff) | |
download | gcc-ce5458c277ba724e6558ba1b78161e70a4a73b76.zip gcc-ce5458c277ba724e6558ba1b78161e70a4a73b76.tar.gz gcc-ce5458c277ba724e6558ba1b78161e70a4a73b76.tar.bz2 |
re PR libfortran/68987 (double free or corruption in _gfortran_st_write_done when a write statement to an internal file uses an invalid format and the ERR= specifier appears.)
2015-12-30 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/68987
* gfortran.dg/error_format_2.f90: New test.
From-SVN: r232007
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/error_format_2.f90 | 16 |
2 files changed, 21 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 2981de9..ba9221c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-12-30 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR fortran/68987 + * gfortran.dg/error_format_2.f90: New test. + 2015-12-30 John David Anglin <danglin@gcc.gnu.org> * gfortran.dg/coarray_40.f90: Revise to use dg-additional-options. diff --git a/gcc/testsuite/gfortran.dg/error_format_2.f90 b/gcc/testsuite/gfortran.dg/error_format_2.f90 new file mode 100644 index 0000000..421da9a --- /dev/null +++ b/gcc/testsuite/gfortran.dg/error_format_2.f90 @@ -0,0 +1,16 @@ +! { dg-do run } +! PR68987, this test case failed on a memory double free +program foo + call s('(foo)') +end program +subroutine s(fmt) + character (*) :: fmt + character (1) :: c + integer :: i + write (c, fmt, iostat=i) 42 + ! print *, i + if (i==0) call abort() + write (c, fmt, err=100) 42 + call abort() +100 continue +end subroutine |