[flang-commits] [PATCH] D100419: [flang] Fix Boolean flag arguments

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Apr 14 11:10:57 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG17e2f236f05a: [flang] Fix Boolean flag arguments (authored by klausler).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100419

Files:
  flang/runtime/buffer.h
  flang/runtime/io-api.cpp


Index: flang/runtime/io-api.cpp
===================================================================
--- flang/runtime/io-api.cpp
+++ flang/runtime/io-api.cpp
@@ -310,7 +310,7 @@
     ExternalUnit unitNumber, const char *sourceFile, int sourceLine) {
   Terminator terminator{sourceFile, sourceLine};
   ExternalFileUnit &unit{ExternalFileUnit::LookUpOrCreateAnonymous(
-      unitNumber, Direction::Output, true /*formatted*/, terminator)};
+      unitNumber, Direction::Output, false /*formatted*/, terminator)};
   return &unit.BeginIoStatement<ExternalMiscIoStatementState>(
       unit, ExternalMiscIoStatementState::Endfile, sourceFile, sourceLine);
 }
@@ -319,7 +319,7 @@
     ExternalUnit unitNumber, const char *sourceFile, int sourceLine) {
   Terminator terminator{sourceFile, sourceLine};
   ExternalFileUnit &unit{ExternalFileUnit::LookUpOrCreateAnonymous(
-      unitNumber, Direction::Input, true /*formatted*/, terminator)};
+      unitNumber, Direction::Input, false /*formatted*/, terminator)};
   return &unit.BeginIoStatement<ExternalMiscIoStatementState>(
       unit, ExternalMiscIoStatementState::Rewind, sourceFile, sourceLine);
 }
Index: flang/runtime/buffer.h
===================================================================
--- flang/runtime/buffer.h
+++ flang/runtime/buffer.h
@@ -79,7 +79,7 @@
       MakeDataContiguous(handler, bytes);
       RUNTIME_CHECK(handler, at == fileOffset_ + frame_);
     }
-    while (FrameLength() < bytes) {
+    if (FrameLength() < bytes) {
       auto next{start_ + length_};
       RUNTIME_CHECK(handler, next < size_);
       auto minBytes{bytes - FrameLength()};
@@ -88,9 +88,6 @@
           fileOffset_ + length_, buffer_ + next, minBytes, maxBytes, handler)};
       length_ += got;
       RUNTIME_CHECK(handler, length_ <= size_);
-      if (got < minBytes) {
-        break; // error or EOF & program can handle it
-      }
     }
     return FrameLength();
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100419.337496.patch
Type: text/x-patch
Size: 1935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20210414/3f4cb592/attachment-0001.bin>


More information about the flang-commits mailing list