[flang] Fix potential segfault in PointerAssociateRemapping
authorValentin Clement <clementval@gmail.com>
Tue, 28 Feb 2023 13:01:10 +0000 (14:01 +0100)
committerValentin Clement <clementval@gmail.com>
Tue, 28 Feb 2023 13:01:32 +0000 (14:01 +0100)
commit91ee72d10e9f64c8c046115c5cdf35e08dd6f70d
treede42d5f27f9296d57b5ba7d0986d2435966be3fd
parent905fa15d84a69a0b31332868880568c825d9b0f1
[flang] Fix potential segfault in PointerAssociateRemapping

The bounds descriptor passed to the function is an array of [2, newRank]
size. Update the code so the rank is retrieved from the second dimension
and not the rank of the descriptor directly as it will be 2 in any case.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D144949
flang/runtime/pointer.cpp