PR fortran/50050
* expr.c (gfc_free_shape): Do nothing if shape is NULL.
(free_expr0): Remove redundant NULL shape check.
* resolve.c (check_host_association): Ditto.
* trans-expr.c (gfc_trans_subarray_assign): Assert that shape is
non-NULL.
* trans-io.c (transfer_array_component): Ditto.
2011-08-25 Mikael Morin <mikael.morin@gcc.gnu.org>
PR fortran/50050
* gfortran.dg/pointer_comp_init_1.f90: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@178086
138bc75d-0d04-0410-961f-
82ee72b054a4
+2011-08-25 Mikael Morin <mikael.morin@gcc.gnu.org>
+
+ PR fortran/50050
+ * expr.c (gfc_free_shape): Do nothing if shape is NULL.
+ (free_expr0): Remove redundant NULL shape check.
+ * resolve.c (check_host_association): Ditto.
+ * trans-expr.c (gfc_trans_subarray_assign): Assert that shape is
+ non-NULL.
+ * trans-io.c (transfer_array_component): Ditto.
+
2011-08-25 Tobias Burnus <burnus@net-b.de>
* trans-array.c (gfc_conv_descriptor_token): Add assert.
void
gfc_free_shape (mpz_t **shape, int rank)
{
+ if (*shape == NULL)
+ return;
+
gfc_clear_shape (*shape, rank);
free (*shape);
*shape = NULL;
}
/* Free a shape array. */
- if (e->shape != NULL)
- gfc_free_shape (&e->shape, e->rank);
+ gfc_free_shape (&e->shape, e->rank);
gfc_free_ref_list (e->ref);
&& sym->attr.contained)
{
/* Clear the shape, since it might not be valid. */
- if (e->shape != NULL)
- gfc_free_shape (&e->shape, e->rank);
+ gfc_free_shape (&e->shape, e->rank);
/* Give the expression the right symtree! */
gfc_find_sym_tree (e->symtree->name, NULL, 1, &st);
gfc_add_block_to_block (&block, &loop.pre);
gfc_add_block_to_block (&block, &loop.post);
+ gcc_assert (lss->shape != NULL);
gfc_free_shape (&lss->shape, cm->as->rank);
gfc_cleanup_loop (&loop);
gfc_add_block_to_block (&block, &loop.pre);
gfc_add_block_to_block (&block, &loop.post);
+ gcc_assert (ss->shape != NULL);
gfc_free_shape (&ss->shape, cm->as->rank);
gfc_cleanup_loop (&loop);
+2011-08-25 Mikael Morin <mikael.morin@gcc.gnu.org>
+
+ PR fortran/50050
+ * gfortran.dg/pointer_comp_init_1.f90: New test.
+
2011-08-25 Jason Merrill <jason@redhat.com>
PR c++/50157
--- /dev/null
+! { dg-do compile }
+!
+! PR fortran/50050
+! ICE whilst trying to access NULL shape.
+
+! Reduced from the FoX library http://www1.gly.bris.ac.uk/~walker/FoX/
+! Contributed by Andrew Benson <abenson@its.caltech.edu>
+
+module m_common_attrs
+ implicit none
+
+ type dict_item
+ end type dict_item
+
+ type dict_item_ptr
+ type(dict_item), pointer :: d => null()
+ end type dict_item_ptr
+
+contains
+
+ subroutine add_item_to_dict()
+ type(dict_item_ptr), pointer :: tempList(:)
+ integer :: n
+
+ allocate(tempList(0:n+1))
+ end subroutine add_item_to_dict
+
+end module m_common_attrs
+
+! { dg-final { cleanup-modules "m_common_attrs" } }