[flang-commits] [PATCH] D127420: [flang][runtime] Fix nonadvancing output edge case

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Jun 13 10:27:53 PDT 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rG2496938522aa: [flang][runtime] Fix nonadvancing output edge case (authored by klausler).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D127420

Files:
  flang/runtime/io-stmt.cpp


Index: flang/runtime/io-stmt.cpp
===================================================================
--- flang/runtime/io-stmt.cpp
+++ flang/runtime/io-stmt.cpp
@@ -325,10 +325,9 @@
     if (mutableModes().nonAdvancing) {
       // Make effects of positioning past the last Emit() visible with blanks.
       std::int64_t n{unit().positionInRecord - unit().furthestPositionInRecord};
-      unit().positionInRecord = unit().furthestPositionInRecord;
       while (n-- > 0 && unit().Emit(" ", 1, 1, *this)) {
       }
-      unit().leftTabLimit = unit().furthestPositionInRecord;
+      unit().leftTabLimit = unit().positionInRecord;
     } else {
       unit().AdvanceRecord(*this);
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127420.436466.patch
Type: text/x-patch
Size: 690 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20220613/1732b93e/attachment.bin>


More information about the flang-commits mailing list