re PR fortran/88155 (ICE in gfc_format_decoder, at fortran/error.c:947)

2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88155
	* primary.c (gfc_match_structure_constructor):  Set the locus of
	an expression to avoid a NULL pointer dereference.

2018-12-11  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/88155
	* gfortran.dg/pr70870_1.f90: Update testcase to use -std=gnu.
	* gfortran.dg/pr88155.f90: New test.

From-SVN: r267041
This commit is contained in:
Steven G. Kargl 2018-12-12 00:53:08 +00:00
parent 85c223fa12
commit 2f00fb3d0b
5 changed files with 23 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88155
* primary.c (gfc_match_structure_constructor): Set the locus of
an expression to avoid a NULL pointer dereference.
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88249

View file

@ -3212,6 +3212,7 @@ gfc_match_structure_constructor (gfc_symbol *sym, gfc_expr **result)
e = gfc_get_expr ();
e->symtree = symtree;
e->expr_type = EXPR_FUNCTION;
e->where = gfc_current_locus;
gcc_assert (gfc_fl_struct (sym->attr.flavor)
&& symtree->n.sym->attr.flavor == FL_PROCEDURE);

View file

@ -1,3 +1,9 @@
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88155
* gfortran.dg/pr70870_1.f90: Update testcase to use -std=gnu.
* gfortran.dg/pr88155.f90: New test.
2018-12-11 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/88249

View file

@ -1,4 +1,5 @@
! { dg-do compile }
! { dg-options "-std=gnu" }
! PR fortran/70870
! Contributed by Vittorio Zecca <zeccav at gmail dot com >
type t

View file

@ -0,0 +1,9 @@
! { dg-do compile }
program p
type t
integer :: a
end type
type(t) :: x
data x /t()1/ ! { dg-error "No initializer for component" }
print *, x
end