Skip to content

Commit 2027857

Browse files
authored
[flang][runtime] Clear leftTabLimit at in FinishReadingRecord (#98822)
ExternalFileUnit::FinishReadingRecord() is called at the end of a READ statement, unless the read is non-advancing and there was no error. In the event of an erroneous non-advancing read, however, FinishReadingRecord() leaves ConnectionState::leftTabLimit inhabited by a value, leaving the impression that the *next* record is undergoing a non-advancing operation, and this cause the next operation to fail. In the test case in the reported bug, the next operation is a BACKSPACE, and it ends up doing nothing. The fix is to always reset leftTabLimit in FinishReadingRecord. Fixes #98783.
1 parent f1a8db1 commit 2027857

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

flang/runtime/unit.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ void ExternalFileUnit::FinishReadingRecord(IoErrorHandler &handler) {
268268
recordOffsetInFrame_ = 0;
269269
}
270270
BeginRecord();
271+
leftTabLimit.reset();
271272
}
272273

273274
bool ExternalFileUnit::AdvanceRecord(IoErrorHandler &handler) {

0 commit comments

Comments
 (0)