llvm-project
c893e3d0 - [flang][runtime] Fix runtime crash after bad recoverable OPEN (#111454)

Commit
1 year ago
[flang][runtime] Fix runtime crash after bad recoverable OPEN (#111454) When an OPEN statement with a unit number fails in a recoverable manner, the runtime needs to delete the ExternalFileUnit instance that was created in the unit map. And we do this too soon -- that instance still holds some of the I/O statement state that will be used by a later call into the runtime for EndIoStatement. Move the code that deletes the unit after a failed but recoverable OPEN into ExternalIoStatementBase::EndIoStatement, and don't do things afterwards that would need the I/O statement state that has been destroyed. Fixes https://github.com/llvm/llvm-project/issues/111404.
Author
Parents
Loading