This is an archive of the discontinued LLVM Phabricator instance.

[flang] Don't close stderr in runtime (fixes STOP output)
ClosedPublic

Authored by klausler on Dec 1 2021, 11:30 AM.

Details

Summary

STOP statement output was sometimes failing to appear because
the runtime flushes and shuts down open Fortran units beforehand.
But when file descriptor 2 was closed, the STOP statement output
was suppressed. The fix is to not actually close file descriptors
0-2 if they are connected to Fortran units being closed. This was
already the policy when an OPEN statement was (re-)opening such a
unit, so that logic has been pulled out into a member function and
shared with CLOSE processing.

Diff Detail

Event Timeline

klausler created this revision.Dec 1 2021, 11:30 AM
klausler requested review of this revision.Dec 1 2021, 11:30 AM
vdonaldson accepted this revision.Dec 1 2021, 12:11 PM
This revision is now accepted and ready to land.Dec 1 2021, 12:11 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 1 2021, 1:25 PM