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

2010-10-26  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libgfortran/46010
	* io/list_read.c (nml_parse_qualifier): Add additional conditions for
	setting the end index for loop specification. Fix some whitespace.
	* io/write.c (write_default_char4): Const-ify the source argument.

From-SVN: r165979
This commit is contained in:
Jerry DeLisle 2010-10-26 19:05:08 +00:00
parent 892ae21cc7
commit 5609699aff
3 changed files with 14 additions and 5 deletions

View file

@ -1,3 +1,10 @@
2010-10-26 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/46010
* io/list_read.c (nml_parse_qualifier): Add additional conditions for
setting the end index for loop specification. Fix some whitespace.
* io/write.c (write_default_char4): Const-ify the source argument.
2010-10-21 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/46007

View file

@ -2105,8 +2105,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 == BT_DERIVED)
ls[dim].end = ls[dim].start;
else
dtp->u.p.expanded_read = 1;
@ -2121,12 +2123,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) GFC_DIMENSION_UBOUND(ad[dim]))

View file

@ -65,7 +65,7 @@ memcpy4 (gfc_char4_t *dest, const char *source, int k)
/* Write out default char4. */
static void
write_default_char4 (st_parameter_dt *dtp, gfc_char4_t *source,
write_default_char4 (st_parameter_dt *dtp, const gfc_char4_t *source,
int src_len, int w_len)
{
char *p;