summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-01 20:30:41 +0000
committerjvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4>2013-04-01 20:30:41 +0000
commitaa8d5fc7c4c3450651435822e324f79a3d7a322b (patch)
treefe9a975d0da5ed9d4f9782a4e741693a3c4c3520 /libgfortran
parent18619da58c77461642c36cee9f0463c968877f75 (diff)
downloadgcc-aa8d5fc7c4c3450651435822e324f79a3d7a322b.tar.gz
2013-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/56660 * io/list_read.c (nml_read_obj): Do not reset the read error flag inside nml_read_obj. If the read error flag is found set just exit. Fix some whitespace on comments. (nml_read_obj_data): Reset the read error flag before the first call to nml_read_object. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@197321 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog9
-rw-r--r--libgfortran/io/list_read.c15
2 files changed, 16 insertions, 8 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 4b8e03a557b..fe9ae95a855 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,12 @@
+2013-04-01 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libfortran/56660
+ * io/list_read.c (nml_read_obj): Do not reset the read error flag
+ inside nml_read_obj. If the read error flag is found set just exit.
+ Fix some whitespace on comments.
+ (nml_read_obj_data): Reset the read error flag before the first call
+ to nml_read_object.
+
2013-03-31 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/56786
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c
index be961f1661e..0693e50f4aa 100644
--- a/libgfortran/io/list_read.c
+++ b/libgfortran/io/list_read.c
@@ -2490,9 +2490,9 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
size_t obj_name_len;
void * pdata;
- /* This object not touched in name parsing. */
-
- if (!nl->touched)
+ /* If we have encountered a previous read error or this object has not been
+ touched in name parsing, just return. */
+ if (dtp->u.p.nml_read_error || !nl->touched)
return true;
dtp->u.p.repeat_count = 0;
@@ -2532,10 +2532,8 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
- GFC_DESCRIPTOR_LBOUND(nl,dim))
* GFC_DESCRIPTOR_STRIDE(nl,dim) * nl->size);
- /* Reset the error flag and try to read next value, if
- dtp->u.p.repeat_count=0 */
+ /* If we are finished with the repeat count, try to read next value. */
- dtp->u.p.nml_read_error = 0;
nml_carry = 0;
if (--dtp->u.p.repeat_count <= 0)
{
@@ -2564,8 +2562,8 @@ nml_read_obj (st_parameter_dt *dtp, namelist_info * nl, index_type offset,
break;
case BT_REAL:
- /* Need to copy data back from the real location to the temp in order
- to handle nml reads into arrays. */
+ /* Need to copy data back from the real location to the temp in
+ order to handle nml reads into arrays. */
read_real (dtp, pdata, len);
memcpy (dtp->u.p.value, pdata, dlen);
break;
@@ -3022,6 +3020,7 @@ get_name:
nl = first_nl;
}
+ dtp->u.p.nml_read_error = 0;
if (!nml_read_obj (dtp, nl, 0, pprev_nl, nml_err_msg, nml_err_msg_size,
clow, chigh))
goto nml_err_ret;