Closed
Description
See Fortran 2018 standard: "9.7.3.2 Deallocation of allocatable variables" point 2:
When the execution of a procedure is terminated by execution of a RETURN or END statement, an unsaved
allocatable local variable of the procedure retains its allocation and definition status if it is a function result or a
subobject thereof; otherwise, if it is allocated it will be deallocated.
This is currently not implemented and does not have a TODO. This causes:
- memory leaks in program relying on this feature.
- lack of type finalization for allocatable that require it.
This should be implemented in ConvertVariable.cpp here:
, in a similar way to what is done for local objects that require finalization (see the code belowif needEndFinalization
), except deallocation must be added to the function context cleanups.Metadata
Metadata
Assignees
Type
Projects
Status
Done