Skip to content
Snippets Groups Projects
Commit a6802746 authored by Andre Vehreschild's avatar Andre Vehreschild
Browse files

Fortran: Free alloc. comp. in allocated coarrays only.

When freeing allocatable components of an allocatable coarray, add
a check that the coarray is still allocated, before accessing the
components.

This patch adds to PR fortran/37336, but does not fix it completely.

gcc/fortran/ChangeLog:
	PR fortran/37336
	* trans-array.cc (structure_alloc_comps): Deref coarray.
	(gfc_trans_deferred_array): Add freeing of components after
	check for allocated coarray.

gcc/testsuite/ChangeLog:
	PR fortran/37336
	* gfortran.dg/coarray/alloc_comp_6.f90: New test.
	* gfortran.dg/coarray/alloc_comp_7.f90: New test.
parent 574cec45
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment