This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran, OOP] PR 47637: Memory leak involving INTENT(OUT) CLASS argument w/ allocatable components


Hi Janus,

It looks OK but for one thing.  Are we guaranteed that tmp =
CLASS_DATA (f->sym)->backend_decl is present?

Should we not check and do the following:

/* Ensure that the vtable is completed.  */
if (CLASS_DATA (f->sym)->backend_decl == NULL_TREE)
  gfc_get_symbol_decl (f->sym);
tmp = CLASS_DATA (f->sym)->backend_decl;
    ?

Or is this impossible?

Thanks for the patch

Paul

On Wed, Feb 9, 2011 at 11:26 AM, Janus Weil <janus@gcc.gnu.org> wrote:
> Hi all,
>
> here is a small patch which takes care of auto-deallocating
> INTENT(OUT) CLASS arguments with allocatable components. Regtested on
> x86_64-unknown-linux-gnu. Ok for trunk?
>
> Cheers,
> Janus
>
>
> 2011-02-09 ?Janus Weil ?<janus@gcc.gnu.org>
>
> ? ? ? ?PR fortran/47637
> ? ? ? ?* trans-decl.c (init_intent_out_dt): Handle CLASS arguments.
>
>
> 2011-02-09 ?Janus Weil ?<janus@gcc.gnu.org>
>
> ? ? ? ?PR fortran/47637
> ? ? ? ?* gfortran.dg/auto_dealloc_2.f90
>



-- 
The knack of flying is learning how to throw yourself at the ground and miss.
? ? ?? --Hitchhikers Guide to the Galaxy


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]