Commit feb6eab0 by Paul Thomas

re PR fortran/54286 (Accepts invalid proc-pointer assignments involving proc-ptr function result)

2013-01-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/54286
	* expr.c (gfc_check_pointer_assign): Check for presence of
	's2' before using it.

2013-01-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/54286
	* gfortran.dg/proc_ptr_result_8.f90 : Add module 'm' to check
	case where interface is null.

From-SVN: r195185
parent 54be5fb3
2013-01-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/54286
* expr.c (gfc_check_pointer_assign): Check for presence of
's2' before using it.
2013-01-14 Thomas Koenig <tkoenig@gcc.gnu.org> 2013-01-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55806 PR fortran/55806
......
...@@ -3537,7 +3537,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue) ...@@ -3537,7 +3537,7 @@ gfc_check_pointer_assign (gfc_expr *lvalue, gfc_expr *rvalue)
name = s2->name; name = s2->name;
} }
if (s2->attr.proc_pointer && s2->ts.interface) if (s2 && s2->attr.proc_pointer && s2->ts.interface)
s2 = s2->ts.interface; s2 = s2->ts.interface;
if (s1 == s2 || !s1 || !s2) if (s1 == s2 || !s1 || !s2)
......
2013-01-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/54286
* gfortran.dg/proc_ptr_result_8.f90 : Add module 'm' to check
case where interface is null.
2013-01-14 Thomas Koenig <tkoenig@gcc.gnu.org> 2013-01-14 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/55806 PR fortran/55806
......
...@@ -2,7 +2,24 @@ ...@@ -2,7 +2,24 @@
! Test fix for PR54286. ! Test fix for PR54286.
! !
! Contributed by Janus Weil <janus@gcc.gnu.org> ! Contributed by Janus Weil <janus@gcc.gnu.org>
! Module 'm' added later because original fix missed possibility of
! null interfaces - thanks to Dominique Dhumieres <dominiq@lps.ens.fr>
! !
module m
type :: foobar
real, pointer :: array(:)
procedure (), pointer, nopass :: f
end type
contains
elemental subroutine fooAssgn (a1, a2)
type(foobar), intent(out) :: a1
type(foobar), intent(in) :: a2
allocate (a1%array(size(a2%array)))
a1%array = a2%array
a1%f => a2%f
end subroutine
end module m
implicit integer (a) implicit integer (a)
type :: t type :: t
procedure(a), pointer, nopass :: p procedure(a), pointer, nopass :: p
......
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