diff --git a/flang/runtime/unit.h b/flang/runtime/unit.h --- a/flang/runtime/unit.h +++ b/flang/runtime/unit.h @@ -96,7 +96,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(); }