[all-commits] [llvm/llvm-project] 2e65c8: [flang] Allow write after non advancing read in IO...

jeanPerier via All-commits all-commits at lists.llvm.org
Tue Nov 16 05:54:33 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2e65c8e8db1887a39c9140b75a9f5bb892ddd93f
      https://github.com/llvm/llvm-project/commit/2e65c8e8db1887a39c9140b75a9f5bb892ddd93f
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2021-11-16 (Tue, 16 Nov 2021)

  Changed paths:
    M flang/runtime/io-stmt.cpp
    M flang/runtime/unit.cpp
    M flang/unittests/Runtime/ExternalIOTest.cpp

  Log Message:
  -----------
  [flang] Allow write after non advancing read in IO runtime

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.

Differential Revision: https://reviews.llvm.org/D113740




More information about the All-commits mailing list