This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix ICE with invalid OPEN ACCESS= argument


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]