[all-commits] [llvm/llvm-project] 07e053: [flang][runtime] Fix finalization case in assignme...

Peter Klausler via All-commits all-commits at lists.llvm.org
Tue Nov 5 13:18:20 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 07e053fb95e131244dafab04aae84650de383664
      https://github.com/llvm/llvm-project/commit/07e053fb95e131244dafab04aae84650de383664
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2024-11-05 (Tue, 05 Nov 2024)

  Changed paths:
    M flang/runtime/assign.cpp

  Log Message:
  -----------
  [flang][runtime] Fix finalization case in assignment (#113611)

There were two bugs in derived type array assignment processing that
caused finalization to fail to occur for a test case. The first bug was
an off-by-one error in address overlap testing that caused a false
positive result for the test, whose left-hand side's allocatable's
descriptor was immediately adjacent in memory to the right-hand side's
array's data.
The second bug was that in such overlap cases (even when legitimate)
finalization would fail due to the LHS's descriptor having been copied
to a temporary for deferred deallocation and then nullified.

This patch corrects the overlap analysis for this test, and also
properly finalizes the LHS when overlap does exist. Some nearby dead
code was removed to avoid future confusion.

Fixes https://github.com/llvm/llvm-project/issues/113375.



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