re PR fortran/46010 (I/O: Namelist-reading bug)

2010-11-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/46010
	Backport from mainline:
	* io/list_read.c (nml_parse_qualifier): Add additional conditions for
	setting the end index for loop specification. Fix some whitespace.

From-SVN: r166294
This commit is contained in:
Jerry DeLisle 2010-11-04 00:34:16 +00:00
parent 6b36833ebd
commit 74a16ffe4a
2 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,10 @@
2010-11-03 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/46010
Backport from mainline:
* io/list_read.c (nml_parse_qualifier): Add additional conditions for
setting the end index for loop specification. Fix some whitespace.
2010-10-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
Backport from mainline:

View File

@ -2077,8 +2077,10 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
/* If -std=f95/2003 or an array section is specified,
do not allow excess data to be processed. */
if (is_array_section == 1
|| compile_options.allow_std < GFC_STD_GNU)
if (is_array_section == 1
|| !(compile_options.allow_std & GFC_STD_GNU)
|| !dtp->u.p.ionml->touched
|| dtp->u.p.ionml->type == GFC_DTYPE_DERIVED)
ls[dim].end = ls[dim].start;
else
dtp->u.p.expanded_read = 1;
@ -2093,12 +2095,12 @@ nml_parse_qualifier (st_parameter_dt *dtp, descriptor_dimension *ad,
}
if (is_array_section == 1 && dtp->u.p.expanded_read == 1)
{
{
int i;
dtp->u.p.expanded_read = 0;
for (i = 0; i < dim; i++)
ls[i].end = ls[i].start;
}
}
/* Check the values of the triplet indices. */
if ((ls[dim].start > (ssize_t)ad[dim].ubound)