[Patch, Fortran, OOP] PR 64230: [4.9/5 Regression] Invalid memory reference in a compiler-generated finalizer for allocatable component

Tobias Burnus burnus@net-b.de
Sat Jan 24 17:18:00 GMT 2015


Janus Weil wrote:
> this is a second patch dealing with finalization-related regressions,
> [...]
> This patch fixes an invalid memory reference inside the finalizer
> routine (at runtime), which apparently was caused by dereferencing a
> pointer without checking if it's NULL. I simply insert a call to
> ASSOCIATED.
> [...]
>
> This one regtests cleanly on x86_64-unknown-linux-gnu. Ok for trunk and 4.9?

OK. Thanks for the patch!

Tobias

> 2015-01-19  Janus Weil  <janus@gcc.gnu.org>
>
>      PR fortran/64230
>      * class.c (finalize_component): New argument 'sub_ns'. Insert code to
>      check if 'expr' is associated.
>      (generate_finalization_wrapper): Rename 'ptr' symbols to 'ptr1' and
>      'ptr2'. Pass 'sub_ns' to finalize_component.
>
> 2015-01-19  Janus Weil  <janus@gcc.gnu.org>
>
>      PR fortran/64230
>      * gfortran.dg/class_allocate_18.f90: Extended.



More information about the Fortran mailing list