This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
[PATCH] Fix ICE with invalid OPEN ACCESS= argument
- From: Jakub Jelinek <jakub at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Tue, 29 Nov 2005 06:44:01 -0500
- Subject: [PATCH] Fix ICE with invalid OPEN ACCESS= argument
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
Hi!
As the testcase below shows, gfc_resolve_open wasn't checking ACCESS=
argument and thus not issuing needed diagnostics and later on dying on
ICE in set_string. Tested on x86_64-linux.
Ok for trunk/4.1/4.0?
2005-11-29 Jakub Jelinek <jakub@redhat.com>
* io.c (gfc_resolve_open): RESOLVE_TAG access field as well.
* gfortran.dg/open_access_1.f90: New test.
--- gcc/fortran/io.c.jj 2005-11-19 10:08:37.000000000 +0100
+++ gcc/fortran/io.c 2005-11-29 11:32:05.000000000 +0100
@@ -1149,6 +1149,7 @@ gfc_resolve_open (gfc_open * open)
RESOLVE_TAG (&tag_iostat, open->iostat);
RESOLVE_TAG (&tag_file, open->file);
RESOLVE_TAG (&tag_status, open->status);
+ RESOLVE_TAG (&tag_e_access, open->access);
RESOLVE_TAG (&tag_e_form, open->form);
RESOLVE_TAG (&tag_e_recl, open->recl);
--- gcc/testsuite/gfortran.dg/open_access_1.f90.jj 2005-11-29 11:38:13.000000000 +0100
+++ gcc/testsuite/gfortran.dg/open_access_1.f90 2005-11-29 11:38:08.000000000 +0100
@@ -0,0 +1,6 @@
+! { dg-do compile }
+
+ real :: a
+ a = 6.0
+ open (unit = 6, file = 'foo', access = a) ! { dg-error "must be of type CHARACTER" }
+end
Jakub