Commit b35a0ccd by Steven G. Kargl

re PR fortran/82994 (ICE in gfc_match_deallocate, at fortran/match.c:4478)

2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82994
	* match.c (gfc_match_deallocate): Check for NULL pointer.

2018-02-07  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/82994
	* gfortran.dg/deallocate_error_3.f90: New test.
	* gfortran.dg/deallocate_error_4.f90: New test.

From-SVN: r257465
parent 72267602
2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/82994
* match.c (gfc_match_deallocate): Check for NULL pointer.
2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org> 2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68560 PR fortran/68560
......
...@@ -4632,8 +4632,8 @@ gfc_match_deallocate (void) ...@@ -4632,8 +4632,8 @@ gfc_match_deallocate (void)
&& (tail->expr->ref->type == REF_COMPONENT && (tail->expr->ref->type == REF_COMPONENT
|| tail->expr->ref->type == REF_ARRAY)); || tail->expr->ref->type == REF_ARRAY));
if (sym && sym->ts.type == BT_CLASS) if (sym && sym->ts.type == BT_CLASS)
b2 = !(CLASS_DATA (sym)->attr.allocatable b2 = !(CLASS_DATA (sym) && (CLASS_DATA (sym)->attr.allocatable
|| CLASS_DATA (sym)->attr.class_pointer); || CLASS_DATA (sym)->attr.class_pointer));
else else
b2 = sym && !(sym->attr.allocatable || sym->attr.pointer b2 = sym && !(sym->attr.allocatable || sym->attr.pointer
|| sym->attr.proc_pointer); || sym->attr.proc_pointer);
......
2018-02-07 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/82994
* gfortran.dg/deallocate_error_3.f90: New test.
* gfortran.dg/deallocate_error_4.f90: New test.
2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org> 2018-02-07 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/68560 PR fortran/68560
......
! { dg-do compile }
! PR fortran/82994
! Code contributed by Gerhard Steinmetz
program p
type t
end type
class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
deallocate (x) ! { dg-error "not a nonprocedure pointer nor an allocatable" }
end
! { dg-do compile }
! PR fortran/82994
! Code contributed by Gerhard Steinmetz
program p
type t
end type
class(t) :: x ! { dg-error "must be dummy, allocatable or pointer" }
allocate (x) ! { dg-error "neither a data pointer nor an allocatable" }
deallocate (x) ! { dg-error "not a nonprocedure pointer nor an allocatable" }
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment