This is an archive of the discontinued LLVM Phabricator instance.

[flang] Allow write after non advancing read in IO runtime
ClosedPublic

Authored by jeanPerier on Nov 12 2021, 1:00 AM.

Details

Summary
  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.

  1. 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.

Diff Detail

Event Timeline

jeanPerier created this revision.Nov 12 2021, 1:00 AM
jeanPerier requested review of this revision.Nov 12 2021, 1:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 12 2021, 1:00 AM
klausler accepted this revision.Nov 12 2021, 10:23 AM

Thanks for figuring out this interaction.

This revision is now accepted and ready to land.Nov 12 2021, 10:23 AM