[flang-commits] [PATCH] D113740: [flang] Allow write after non advancing read in IO runtime

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Nov 12 01:00:31 PST 2021


jeanPerier created this revision.
jeanPerier added a reviewer: klausler.
jeanPerier added a project: Flang.
Herald added a subscriber: jdoerfert.
jeanPerier requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

1. To avoid overwriting the part of the record read in the non advancing read,

the furtherPositionInRecord field must be set to the max of the
furtherPositionInRecord and the positionInRecord at the beginning of the
IO write.

2. To allow any further read to succeed after the write, the unit

beganReadingRecord_ must be set to false when resetting the recordLength
during the write, otherwise, recordLength will not be computed in further
read and an assert is hit (at unit.cpp(398)).

The added unit test exercises both of these scenarios.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D113740

Files:
  flang/runtime/io-stmt.cpp
  flang/runtime/unit.cpp
  flang/unittests/Runtime/ExternalIOTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D113740.386755.patch
Type: text/x-patch
Size: 6037 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211112/dbc97834/attachment.bin>


More information about the flang-commits mailing list