aboutsummaryrefslogtreecommitdiff
path: root/libcpp/init.c
diff options
context:
space:
mode:
authorPaul Thomas <pault@gcc.gnu.org>2021-02-24 16:00:51 +0000
committerPaul Thomas <pault@gcc.gnu.org>2021-02-24 16:01:08 +0000
commit5159b88ef1a1774ec8851c6b92794ae2bf6e0b74 (patch)
tree777a8c1edad455148d80dd771ad40a8ac6028d49 /libcpp/init.c
parentbe30dd89926d5dd19d72f90c1586b0e2557fde43 (diff)
downloadgcc-5159b88ef1a1774ec8851c6b92794ae2bf6e0b74.zip
gcc-5159b88ef1a1774ec8851c6b92794ae2bf6e0b74.tar.gz
gcc-5159b88ef1a1774ec8851c6b92794ae2bf6e0b74.tar.bz2
Fortran: Fix memory problems with assumed rank formal args [PR98342].
2021-02-24 Paul Thomas <pault@gcc.gnu.org> gcc/fortran PR fortran/98342 * trans-expr.c (gfc_conv_derived_to_class): Add optional arg. 'derived_array' to hold the fixed, parmse expr in the case of assumed rank formal arguments. Deal with optional arguments. (gfc_conv_procedure_call): Null 'derived' array for each actual argument. Add its address to the call to gfc_conv_derived_to_ class. Access the 'data' field of scalar descriptors before deallocating allocatable components. Also strip NOPs before the calls to gfc_deallocate_alloc_comp. Use 'derived' array as the input to gfc_deallocate_alloc_comp if it is available. * trans.h : Include the optional argument 'derived_array' to the prototype of gfc_conv_derived_to_class. The default value is NULL_TREE. gcc/testsuite/ PR fortran/98342 * gfortran.dg/assumed_rank_21.f90 : New test.
Diffstat (limited to 'libcpp/init.c')
0 files changed, 0 insertions, 0 deletions