[flang] Fix READ/WRITE with POS= on stream units, with refactoring
First, ExternalFileUnit::SetPosition was being used both as a utility within the class' member functions as well as an API from I/O statement processing. Make it private, and add APIs for SetStreamPos and SetDirectRec. Second, ensure that SetStreamPos for POS= positioning in a stream doesn't leave the current record number and endfile record number in an arbitrary state. In stream I/O they are used only to manage end-of-file detection, and shouldn't produce false positive results from IsAtEnd() after repositioning. Differential Revision: https://reviews.llvm.org/D128388
Loading
Please sign in to comment