[flang-commits] [PATCH] D112742: [flang] Revert new unintended runtime behavior

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Thu Oct 28 14:44:53 PDT 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG8b5b38eb2487: [flang] Revert new unintended runtime behavior (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/D112742/new/

https://reviews.llvm.org/D112742

Files:
  flang/runtime/unit.cpp


Index: flang/runtime/unit.cpp
===================================================================
--- flang/runtime/unit.cpp
+++ flang/runtime/unit.cpp
@@ -455,6 +455,7 @@
       furthestPositionInRecord = *recordLength;
     }
     if (!(isFixedRecordLength && access == Access::Direct)) {
+      positionInRecord = furthestPositionInRecord;
       if (isUnformatted.value_or(false)) {
         // Append the length of a sequential unformatted variable-length record
         // as its footer, then overwrite the reserved first four bytes of the
@@ -464,7 +465,6 @@
         // headers &/or footers
         std::uint32_t length;
         length = furthestPositionInRecord - sizeof length;
-        positionInRecord = furthestPositionInRecord;
         ok = ok &&
             Emit(reinterpret_cast<const char *>(&length), sizeof length,
                 sizeof length, handler);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112742.383169.patch
Type: text/x-patch
Size: 881 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20211028/67d37734/attachment.bin>


More information about the flang-commits mailing list