[all-commits] [llvm/llvm-project] 87dfec: [flang] Retrieve rank before updating the pointer

Valentin Clement (バレンタイン クレメン) via All-commits all-commits at lists.llvm.org
Mon Dec 5 09:27:36 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 87dfec9dc8991a9a14df3ce3443da296354b5d57
      https://github.com/llvm/llvm-project/commit/87dfec9dc8991a9a14df3ce3443da296354b5d57
  Author: Valentin Clement <clementval at gmail.com>
  Date:   2022-12-05 (Mon, 05 Dec 2022)

  Changed paths:
    M flang/runtime/pointer.cpp

  Log Message:
  -----------
  [flang] Retrieve rank before updating the pointer

The code is iterating on the rank of the pointer to set the bounds.
If the rank is retrieved after the `pointer = target` it does not
reflect the actual rank of the pointer.

This could happen in code like the following:

```
type t1
  integer :: a
end type

type(t), pointer :: p(:)
class(t), pointer :: q(:,:)
q(0:1,-2:2) => p(10:1:-1)
```

Reviewed By: klausler

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




More information about the All-commits mailing list