[flang-commits] [flang] aac6e25 - [flang][runtime] Signal record read overrun when PAD='NO'

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Fri Apr 22 16:58:37 PDT 2022


Author: Peter Klausler
Date: 2022-04-22T16:52:05-07:00
New Revision: aac6e25f7d3cbed7a734c2419f3d8c0c76461ba6

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

LOG: [flang][runtime] Signal record read overrun when PAD='NO'

When PAD='NO' and ADVANCE='YES', we currently signal an input
error when a formatted read tries to go past the end of a record
only when a fixed RECL= is in effect.  Other compilers will signal
an error without RECL= too, and that seems like a precedent we
should follow.

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

Added: 
    

Modified: 
    flang/runtime/io-stmt.cpp

Removed: 
    


################################################################################
diff  --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp
index f50d332e108f4..ad0a4dc249ee3 100644
--- a/flang/runtime/io-stmt.cpp
+++ b/flang/runtime/io-stmt.cpp
@@ -674,7 +674,7 @@ bool IoStatementState::CheckForEndOfRecord() {
         IoErrorHandler &handler{GetIoErrorHandler()};
         if (mutableModes().nonAdvancing) {
           handler.SignalEor();
-        } else if (connection.openRecl && !connection.modes.pad) {
+        } else if (!connection.modes.pad) {
           handler.SignalError(IostatRecordReadOverrun);
         }
         return connection.modes.pad; // PAD='YES'


        


More information about the flang-commits mailing list