[flang-commits] [flang] 1650fb8 - [flang][runtime] Respect PAD='NO' on READ/WRITE
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Thu Jun 23 09:50:34 PDT 2022
Author: Peter Klausler
Date: 2022-06-23T09:50:22-07:00
New Revision: 1650fb8a53ff8eb17e600f1c60c788c3ab550b47
URL: https://github.com/llvm/llvm-project/commit/1650fb8a53ff8eb17e600f1c60c788c3ab550b47
DIFF: https://github.com/llvm/llvm-project/commit/1650fb8a53ff8eb17e600f1c60c788c3ab550b47.diff
LOG: [flang][runtime] Respect PAD='NO' on READ/WRITE
The check for the PAD= setting should examine the mutable modes
of the current I/O statement, not the persistent modes of the
I/O unit.
Differential Revision: https://reviews.llvm.org/D128389
Added:
Modified:
flang/runtime/io-stmt.cpp
Removed:
################################################################################
diff --git a/flang/runtime/io-stmt.cpp b/flang/runtime/io-stmt.cpp
index 3bc3eba7a86b4..ebddf2a53b11e 100644
--- a/flang/runtime/io-stmt.cpp
+++ b/flang/runtime/io-stmt.cpp
@@ -677,7 +677,8 @@ bool IoStatementState::CheckForEndOfRecord() {
if (auto length{connection.EffectiveRecordLength()}) {
if (connection.positionInRecord >= *length) {
IoErrorHandler &handler{GetIoErrorHandler()};
- if (mutableModes().nonAdvancing) {
+ const auto &modes{mutableModes()};
+ if (modes.nonAdvancing) {
if (connection.access == Access::Stream &&
connection.unterminatedRecord) {
// Reading final unterminated record left by a
@@ -687,10 +688,10 @@ bool IoStatementState::CheckForEndOfRecord() {
} else {
handler.SignalEor();
}
- } else if (!connection.modes.pad) {
+ } else if (!modes.pad) {
handler.SignalError(IostatRecordReadOverrun);
}
- return connection.modes.pad; // PAD='YES'
+ return modes.pad; // PAD='YES'
}
}
}
More information about the flang-commits
mailing list