This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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, libgfortran] Inquire internal unit within child dtio procedure


Committed as trivial. Reported on c.l.f  Regression tested on x86-64.

Regards,

Jerry

2016-10-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	io/inquire.c (inquire_via_unit): Add check for internal unit
	passed into child IO procedure.

2016-10-04  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* gfortran.dg/dtio_15.f90: New test.

r240766 = d59520df9fe83f1a9aea7e766cef52bf6ec790df (refs/remotes/svn/trunk)
	A	gcc/testsuite/gfortran.dg/dtio_15.f90
	M	libgfortran/ChangeLog
	M	libgfortran/io/inquire.c


diff --git a/libgfortran/io/inquire.c b/libgfortran/io/inquire.c
index 2bb518b6..7751b8df 100644
--- a/libgfortran/io/inquire.c
+++ b/libgfortran/io/inquire.c
@@ -41,7 +41,9 @@ inquire_via_unit (st_parameter_inquire *iqp, gfc_unit * u)
   const char *p;
   GFC_INTEGER_4 cf = iqp->common.flags;

- if (iqp->common.unit == GFC_INTERNAL_UNIT || iqp->common.unit == GFC_INTERNAL_UNIT4)
+  if (iqp->common.unit == GFC_INTERNAL_UNIT ||
+       iqp->common.unit == GFC_INTERNAL_UNIT4 ||
+       u->internal_unit_kind != 0)
     generate_error (&iqp->common, LIBERROR_INQUIRE_INTERNAL_UNIT, NULL);

   if ((cf & IOPARM_INQUIRE_HAS_EXIST) != 0)


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