[all-commits] [llvm/llvm-project] b37e35: [flang] Carry over the derived type from MOLD

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Wed Feb 8 00:27:43 PST 2023


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

  Changed paths:
    M flang/runtime/allocatable.cpp
    M flang/runtime/pointer.cpp

  Log Message:
  -----------
  [flang] Carry over the derived type from MOLD

Derived type from the MOLD was not carried over
to the newly allocated pointer or allocatable.
This may lead to wrong dynamic type when the pointer or allocatable
is polymorphic as shown in the example below:

```
type :: p1
  integer :: a
end type

type, extends(p1) :: p2
  integer :: b
end type

class(p1), pointer :: p(:)

allocate(p(5), MOLD=p2(1,2))
```

Reviewed By: klausler

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




More information about the All-commits mailing list