This is an archive of the discontinued LLVM Phabricator instance.

[Flang] Finalize IO operations after calling EndIO
ClosedPublic

Authored by PeteSteinfeld on Sep 21 2022, 1:23 PM.

Details

Summary

The process of passing arguments to IO calls can cause allocations that
get referenced during EndIO calls. Calling "Finalize" causes these
allocations to be deallocated. This means that references to them in
the code in EndIO will be invalid. The fix is to delay the call to
"finalize" until after the call to EndIO.

This particularly causes problems with the IO items are strings that are
produced by calls to functions.

Diff Detail

Event Timeline

PeteSteinfeld created this revision.Sep 21 2022, 1:23 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 21 2022, 1:23 PM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
PeteSteinfeld requested review of this revision.Sep 21 2022, 1:23 PM
PeteSteinfeld removed a project: Restricted Project.
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2022, 1:24 PM
This revision is now accepted and ready to land.Sep 22 2022, 12:00 AM
jeanPerier accepted this revision.Sep 22 2022, 7:14 AM
This revision was landed with ongoing or failed builds.Sep 22 2022, 7:24 AM
This revision was automatically updated to reflect the committed changes.