diff options
author | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-29 19:17:57 +0000 |
---|---|---|
committer | jvdelisle <jvdelisle@138bc75d-0d04-0410-961f-82ee72b054a4> | 2017-05-29 19:17:57 +0000 |
commit | 18eaba0b2b49260c106dd45c191f10f7b6bf6d78 (patch) | |
tree | 92cfd1b6d2284c50ad86327360b617f65d955161 /libgfortran | |
parent | 87229d1ec3b98f2c04495ab8ab65ca6c4a475e1a (diff) | |
download | gcc-18eaba0b2b49260c106dd45c191f10f7b6bf6d78.tar.gz |
2017-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/53029
* list_read.c (list_formatted_read_scala): Set the err return
value to the common.flags error values.
* gfortran.dg/read_5.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@248577 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r-- | libgfortran/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/list_read.c | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index eaeac6ad0b7..e763232744d 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,9 @@ +2017-05-29 Jerry DeLisle <jvdelisle@gcc.gnu.org> + + PR libgfortran/53029 + * list_read.c (list_formatted_read_scala): Set the err return + value to the common.flags error values. + 2017-05-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * acinclude.m4 (LIBGFOR_CHECK_FMA3): Use test from diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index 6c00d11bf05..b6cd66706bb 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -2298,11 +2298,16 @@ list_formatted_read_scalar (st_parameter_dt *dtp, bt type, void *p, free_saved (dtp); cleanup: + /* err may have been set above from finish_separator, so if it is set + trigger the hit_eof. The hit_eof will set bits in common.flags. */ if (err == LIBERROR_END) { free_line (dtp); hit_eof (dtp); } + /* Now we check common.flags for any errors that could have occurred in + a READ elsewhere such as in read_integer. */ + err = dtp->common.flags & IOPARM_LIBRETURN_MASK; fbuf_flush_list (dtp->u.p.current_unit, LIST_READING); return err; } |