re PR fortran/57033 (ICE on extended derived type and default initialization)

fortran/
       PR fortran/57033
       * primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
       dereference.

testsuite/
        PR fortran/57033
        * gfortran.dg/default_initialization_7.f90: New test.

From-SVN: r207635
This commit is contained in:
Mikael Morin 2014-02-08 20:51:01 +00:00
parent e152a9c8f1
commit e578362334
4 changed files with 35 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2014-02-08 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/57033
* primary.c (gfc_convert_to_structure_constructor): Avoid null pointer
dereference.
2014-02-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/59906

View File

@ -2525,7 +2525,8 @@ gfc_convert_to_structure_constructor (gfc_expr *e, gfc_symbol *sym, gfc_expr **c
if (parent && !comp)
break;
actual = actual->next;
if (actual)
actual = actual->next;
}
if (build_actual_constructor (&comp_head, &ctor_head, sym) == FAILURE)

View File

@ -1,3 +1,8 @@
2014-02-08 Mikael Morin <mikael@gcc.gnu.org>
PR fortran/57033
* gfortran.dg/default_initialization_7.f90: New test.
2014-02-08 Paul Thomas <pault@gcc.gnu.org>
PR fortran/59906

View File

@ -0,0 +1,22 @@
! { dg-do compile }
!
! PR fortran/57033
! ICE on a structure constructor of an extended derived type whose parent
! type last component has a default initializer
!
! Contributed by Tilo Schwarz <tilo@tilo-schwarz.de>
program ice
type m
integer i
logical :: f = .false.
end type m
type, extends(m) :: me
end type me
type(me) meo
meo = me(1) ! ICE
end program ice