[all-commits] [llvm/llvm-project] 5c988c: [flang] Use derivedType from toAddedum to get upda...

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Thu Feb 16 05:54:29 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5c988cba4a669051c819730ad0e8fa925056708b
      https://github.com/llvm/llvm-project/commit/5c988cba4a669051c819730ad0e8fa925056708b
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2023-02-16 (Thu, 16 Feb 2023)

  Changed paths:
    M flang/runtime/assign.cpp

  Log Message:
  -----------
  [flang] Use derivedType from toAddedum to get updated components

When the rhs is polymorphic and allocated during assignment, the
derivedType might have change from the one set in `toDerived`.
Use the one set in the addendum so it is always up to date.

This can happen in cases like the one shown below:

```
type :: t1
end type t1

type, extends(t1) :: t2
  integer, allocatable :: i(:)
end type

subroutine assign(t)
  class(t2), intent(in) :: t
  class(t1), allocatable :: cp

  cp = t
end subroutine
```

Reviewed By: jeanPerier

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




More information about the All-commits mailing list