[flang] Avoid double cleanup when the result is cleaned up by the Destroy function
authorValentin Clement <clementval@gmail.com>
Mon, 6 Mar 2023 16:45:50 +0000 (17:45 +0100)
committerValentin Clement <clementval@gmail.com>
Mon, 6 Mar 2023 16:46:39 +0000 (17:46 +0100)
commit30dc03796894339ceb64f86cbc95f75ea7b78791
treee4ac76c5db333519e9e833b231ec50832707d82f
parent1edc72385a55adabc2803a0cde282c2d28785581
[flang] Avoid double cleanup when the result is cleaned up by the Destroy function

The Destroy runtime function does free the memory so do not do it
inlined when we use Destroy. This avoid a double free execution error.

Reviewed By: PeteSteinfeld

Differential Revision: https://reviews.llvm.org/D145372
flang/lib/Lower/ConvertCall.cpp
flang/test/Lower/derived-type-finalization.f90