[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
This commit is contained in:
parent
c02abb68cd
commit
aac6e25f7d
|
@ -674,7 +674,7 @@ bool IoStatementState::CheckForEndOfRecord() {
|
||||||
IoErrorHandler &handler{GetIoErrorHandler()};
|
IoErrorHandler &handler{GetIoErrorHandler()};
|
||||||
if (mutableModes().nonAdvancing) {
|
if (mutableModes().nonAdvancing) {
|
||||||
handler.SignalEor();
|
handler.SignalEor();
|
||||||
} else if (connection.openRecl && !connection.modes.pad) {
|
} else if (!connection.modes.pad) {
|
||||||
handler.SignalError(IostatRecordReadOverrun);
|
handler.SignalError(IostatRecordReadOverrun);
|
||||||
}
|
}
|
||||||
return connection.modes.pad; // PAD='YES'
|
return connection.modes.pad; // PAD='YES'
|
||||||
|
|
Loading…
Reference in a new issue