fortran: Reuse associated_dummy memory if previously allocated [PR108923]

Harald Anlauf anlauf@gmx.de
Sat Feb 25 17:20:41 GMT 2023


Hi Mikael,

Am 25.02.23 um 17:35 schrieb Mikael Morin:
> Hello,
>
> Harald found a testcase with memory still leaking despite my previous
> patch for PR108923.
> That patch was fixing a leak caused by absence of memory release, the
> attached patch fixes a leak caused by pointer overwrite.
>
> I haven't investigated why sort_actual is called several times( which
> causes the memory leak) nor tried to avoid that.  Theoretically, one
> could assert that the previous associated_dummy value is the same as the
> one to be written (it should be the same at each sort_actual
> invocation), but I have preferred to silently overwrite, and fix just
> the memory problem.
>
> Manually tested on Harald's testcase (predcom-1.f) and ran the full
> fortran testsuite on x86_64-pc-linux-gnu.
>
> OK for master and 12 and 11?

LGTM.  OK for master and 12-branch.

It appears that 11-branch is significantly different in the respective
places.  get_intrinsic_dummy_arg does not exist there, so this patch
seems to not apply there.  Or am I missing something?

Thanks for the patch!

Harald



More information about the Fortran mailing list