[patch,libgfortran] PR88776 Namelist read from stdin: loss of data
Jerry DeLisle
jvdelisle@charter.net
Sat Jan 12 22:35:00 GMT 2019
Hi all,
As stated in the PR, the problem turns out to be an ungraceful return
after an error. Most namelist errors go through nml_err_ret, The one I
am removing did not and in the unique case of UNIT=5 after the error it
falls through and hits some code which modifies pointers to the namelist
data structures.
This patch fixes it.
Regression tested on x86-64 and manually tested with a redirection to
stdin. (cat somefile | ./a.out )
I plan to commit today as simple along with a new testcase.
Regards.
Jerry
2019-01-12 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libfortran/88776
* io/list_read.c (namelist_read): Use nml_err_ret path on
read error, not based on stdin_unit.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr88776.diff
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20190112/4240ed37/attachment.bin>
More information about the Fortran
mailing list