PR fortran/29371
* trans-expr.c (gfc_trans_pointer_assignment): Add the expression
for the assignment of null to the data field to se->pre, rather
than block.
2006-10-14 Paul Thomas <pault@gcc.gnu.org>
PR fortran/29371
* gfortran.dg/nullify_3.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@117732
138bc75d-0d04-0410-961f-
82ee72b054a4
+2006-10-14 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29371
+ * trans-expr.c (gfc_trans_pointer_assignment): Add the expression
+ for the assignment of null to the data field to se->pre, rather
+ than block.
+
2006-10-14 Kazu Hirata <kazu@codesourcery.com>
* intrinsic.texi: Fix typos.
{
case EXPR_NULL:
/* Just set the data pointer to null. */
- gfc_conv_descriptor_data_set (&block, lse.expr, null_pointer_node);
+ gfc_conv_descriptor_data_set (&lse.pre, lse.expr, null_pointer_node);
break;
case EXPR_VARIABLE:
+2006-10-14 Paul Thomas <pault@gcc.gnu.org>
+
+ PR fortran/29371
+ * gfortran.dg/nullify_3.f90: New test.
+
2006-10-14 Eric Botcazou <ebotcazou@libertysurf.fr>
* gcc.dg/pthread-init-2.c (dg-options): Define _POSIX_C_SOURCE=199506L
--- /dev/null
+! { dg-do run }
+! { dg-options "-O0 -fbounds-check" }
+! Tests patch for PR29371, in which the null pointer
+! assignment would cause a segfault with the bounds
+! check on.
+!
+! Contributed by Tobias Burnus <tobias.burnus@physik.fu-berlin.de>
+!
+program test
+ implicit none
+ type projector_t
+ real, pointer :: ket(:, :), bra(:, :)
+ end type projector_t
+
+ type(projector_t),pointer, dimension(:) :: p
+ integer :: stat,i
+ allocate(p(2),stat=stat)
+ do i = 1, 2
+ nullify(p(i)%bra)
+ nullify(p(i)%ket)
+ end do
+ do i = 1, 2
+ if (associated (p(i)%bra)) call abort ()
+ if (associated (p(i)%ket)) call abort ()
+ end do
+end program