[flang-commits] [PATCH] D123730: [flang][runtime] Fix ENDFILE for formatted stream output

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Apr 13 13:17:10 PDT 2022


klausler created this revision.
klausler added a reviewer: clementval.
klausler added a project: Flang.
Herald added a subscriber: jdoerfert.
Herald added a project: All.
klausler requested review of this revision.

A predicate expression made ENDFILE statements significant
only for sequential files, but it's applicable to formatted
stream output as well.


https://reviews.llvm.org/D123730

Files:
  flang/runtime/unit.cpp


Index: flang/runtime/unit.cpp
===================================================================
--- flang/runtime/unit.cpp
+++ flang/runtime/unit.cpp
@@ -839,7 +839,7 @@
 }
 
 void ExternalFileUnit::DoEndfile(IoErrorHandler &handler) {
-  if (access == Access::Sequential) {
+  if (IsRecordFile()) {
     endfileRecordNumber = currentRecordNumber;
   }
   FlushOutput(handler);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D123730.422632.patch
Type: text/x-patch
Size: 380 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220413/0fb6fcea/attachment.bin>


More information about the flang-commits mailing list