[flang][runtime] Handle unconsumed repeated list-directed input items (#75400)
commit9469dc38b01b857a6bef8a57480a30ddba61647d
authorPeter Klausler <35819229+klausler@users.noreply.github.com>
Tue, 26 Dec 2023 23:44:31 +0000 (26 15:44 -0800)
committerGitHub <noreply@github.com>
Tue, 26 Dec 2023 23:44:31 +0000 (26 15:44 -0800)
treec9e2ca8940dc593413dd93568f807d0bc2debcf6
parent7b50176805ff53994ab87bbce7c3b7840bbc85ab
[flang][runtime] Handle unconsumed repeated list-directed input items (#75400)

If list-directed input contains a repeated item ("20*123.0") that is not
fully consumed by the READ statement's data item list, the end of that
READ statement was repositioning the input to the repeated value
("123.0"), leading to later confusion. Cancel the input item repetition
during EndIoStatement() processing to prevent this misbehavior.

Fixes llvm-test-suite/Fortran/gfortran/regression/list_read_4.f90.
flang/runtime/connection.cpp
flang/runtime/connection.h
flang/runtime/io-stmt.cpp
flang/runtime/io-stmt.h