Index: flang/runtime/unit.h =================================================================== --- flang/runtime/unit.h +++ flang/runtime/unit.h @@ -97,7 +97,7 @@ void SetPosition(std::int64_t, IoErrorHandler &); // zero-based std::int64_t InquirePos() const { // 12.6.2.11 defines POS=1 as the beginning of file - return frameOffsetInFile_ + 1; + return frameOffsetInFile_ + recordOffsetInFrame_ + positionInRecord + 1; } ChildIo *GetChildIo() { return child_.get(); }