[flang-commits] [PATCH] D127789: [flang][runtime] Fix INQUIRE(POS=n) for non-advancing I/O

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Jun 15 14:17:29 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGf6253eb9ba38: [flang][runtime] Fix INQUIRE(POS=n) for non-advancing I/O (authored by klausler).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D127789/new/

https://reviews.llvm.org/D127789

Files:
  flang/runtime/unit.h


Index: flang/runtime/unit.h
===================================================================
--- flang/runtime/unit.h
+++ 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(); }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127789.437333.patch
Type: text/x-patch
Size: 496 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220615/e3630a9f/attachment.bin>


More information about the flang-commits mailing list