[PATCH] Fix ICE with invalid OPEN ACCESS= argument
Jakub Jelinek
jakub@redhat.com
Tue Nov 29 11:44:00 GMT 2005
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
More information about the Fortran
mailing list