[flang-commits] [flang] 6963fb7 - [flang][runtime] Fix REWIND after non-advancing data transfer

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Wed Jun 15 13:41:02 PDT 2022


Author: Peter Klausler
Date: 2022-06-15T13:40:49-07:00
New Revision: 6963fb7dfb56abb6e3535a88fdc101cf0e1f6366

URL: https://github.com/llvm/llvm-project/commit/6963fb7dfb56abb6e3535a88fdc101cf0e1f6366
DIFF: https://github.com/llvm/llvm-project/commit/6963fb7dfb56abb6e3535a88fdc101cf0e1f6366.diff

LOG: [flang][runtime] Fix REWIND after non-advancing data transfer

A REWIND of a unit that's in the middle of a record due to a READ
or WRITE statement with ADVANCE='NO' needs to reset the left tab
limit so that the next transfer takes place at the beginning of
the first record.

Differential Revision: https://reviews.llvm.org/D127783

Added: 
    

Modified: 
    flang/runtime/unit.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/unit.cpp b/flang/runtime/unit.cpp
index 036ff9bfb2b5c..2d1beb5b5e643 100644
--- a/flang/runtime/unit.cpp
+++ b/flang/runtime/unit.cpp
@@ -640,6 +640,7 @@ void ExternalFileUnit::Rewind(IoErrorHandler &handler) {
   } else {
     SetPosition(0, handler);
     currentRecordNumber = 1;
+    leftTabLimit.reset();
   }
 }
 


        


More information about the flang-commits mailing list