This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran, OOP] PR 64209: runtime segfault with CLASS(*), INTENT(OUT) dummy argument
- From: Tobias Burnus <tobias dot burnus at physik dot fu-berlin dot de>
- To: Janus Weil <janus at gcc dot gnu dot org>, gcc-patches at gcc dot gnu dot org, fortran at gcc dot gnu dot org
- Date: Fri, 19 Dec 2014 14:48:50 +0100
- Subject: Re: [Patch, Fortran, OOP] PR 64209: runtime segfault with CLASS(*), INTENT(OUT) dummy argument
- Authentication-results: sourceware.org; auth=none
Janus Weil wrote:
> the attached patch fixes a wrong-code issue with unlimited poylmorphic
> INTENT(OUT) arguments.
>
> We default-initialize all polymorphic INTENT(OUT) arguments via the
> _def_init component of the vtable. The problem is that the intrinsic
> types don't have a default initialization. Therefore their _def_init
> is NULL and we simply failed to check for that condition. That's what
> the patch does. It regtests cleanly on x86_64-unknown-linux-gnu.
>
> Ok for trunk?
As you write yourself, the issue can only occur for CLASS(*). Hence,
please apply this only for UNLIMITED_POLY() to avoid unneccessary code side
increase and performance decrease.
OK this this change. Thanks for the patch!
Tobias