[all-commits] [llvm/llvm-project] 76fd4b: [Flang] Finalize IO operations after calling EndIO

Pete Steinfeld via All-commits all-commits at lists.llvm.org
Thu Sep 22 07:24:15 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 76fd4bf675b5ceeeca0e4e15cf15d89c7acf4947
      https://github.com/llvm/llvm-project/commit/76fd4bf675b5ceeeca0e4e15cf15d89c7acf4947
  Author: Peter Steinfeld <psteinfeld at nvidia.com>
  Date:   2022-09-22 (Thu, 22 Sep 2022)

  Changed paths:
    M flang/lib/Lower/IO.cpp
    A flang/test/Lower/io-write.f90

  Log Message:
  -----------
  [Flang] Finalize IO operations after calling EndIO

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.

Differential Revision: https://reviews.llvm.org/D134383




More information about the All-commits mailing list