forked from OSchip/llvm-project
[flang][runtime] Fix INQUIRE(POS=n) for non-advancing I/O
Position inquiries need to account for offsets in records to be accurate in the case of non-advancing I/O. Differential Revision: https://reviews.llvm.org/D127789
This commit is contained in:
parent
8ef1075381
commit
f6253eb9ba
|
@ -96,7 +96,7 @@ public:
|
|||
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(); }
|
||||
|
|
Loading…
Reference in New Issue