[all-commits] [llvm/llvm-project] c893e3: [flang][runtime] Fix runtime crash after bad recov...

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Oct 10 10:25:20 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c893e3d02d1f7b67880090485a030b79741bba1c
      https://github.com/llvm/llvm-project/commit/c893e3d02d1f7b67880090485a030b79741bba1c
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2024-10-10 (Thu, 10 Oct 2024)

  Changed paths:
    M flang/runtime/io-stmt.cpp
    M flang/runtime/io-stmt.h

  Log Message:
  -----------
  [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.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list