[flang] Avoid deallocation of intent(out) when dummy arg is not in entry stmt
authorValentin Clement <clementval@gmail.com>
Wed, 21 Sep 2022 16:47:41 +0000 (18:47 +0200)
committerValentin Clement <clementval@gmail.com>
Wed, 21 Sep 2022 16:48:09 +0000 (18:48 +0200)
commitf3222be4fcb76e8c70aa8ebfb68ebf6ace1c6aee
tree9d0825a1ad8979434644ddc8414059d0ff8e3446
parent006a752a3c033950eb16db6b63574c309fa43241
[flang] Avoid deallocation of intent(out) when dummy arg is not in entry stmt

In some case, the ENTRY statement in a procedure is including some
dummy argument. Until now, deallocation of intent(out) allocatable was
not checking for this and it could result in a segmentation fault.

This patch avoids deallocation when the value is not in the ENTRY stmt.

Reviewed By: jeanPerier, PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D134342
flang/lib/Lower/ConvertVariable.cpp
flang/test/Lower/intentout-deallocate.f90