[flang] Fix crash on empty formatted external READs
ExternalFileUnit::BeginReadingRecord() must be called at least once during an external formatted READ statement before FinishReadingRecord(). In the case of a formatted external READ with no data items, the call to finish processing of the format (which might have lingering control items that need doing) was taking place before the call to BeginReadingRecord from ExternalIoStatementState::EndIoStatement. Add a call to BeginReadingRecord on this path. Differential Revision: https://reviews.llvm.org/D112351
Loading
Please sign in to comment