re PR fortran/42309 (Problem with a pointer array passed to a subroutine)

PR fortran/42309
	* trans-expr.c (gfc_conv_subref_array_arg): Avoid accessing
	info->dimen after info has been freed.

From-SVN: r156659
This commit is contained in:
Jakub Jelinek 2010-02-10 16:10:53 +01:00 committed by Jakub Jelinek
parent 92e8e53a31
commit 45406a12e9
2 changed files with 10 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2010-02-10 Jakub Jelinek <jakub@redhat.com>
PR fortran/42309
* trans-expr.c (gfc_conv_subref_array_arg): Avoid accessing
info->dimen after info has been freed.
2010-02-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/42999

View File

@ -2311,6 +2311,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
tree size;
stmtblock_t body;
int n;
int dimen;
gcc_assert (expr->expr_type == EXPR_VARIABLE);
@ -2439,9 +2440,10 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
outside the innermost loop, so the overall transfer could be
optimized further. */
info = &rse.ss->data.info;
dimen = info->dimen;
tmp_index = gfc_index_zero_node;
for (n = info->dimen - 1; n > 0; n--)
for (n = dimen - 1; n > 0; n--)
{
tree tmp_str;
tmp = rse.loop->loopvar[n];
@ -2508,7 +2510,7 @@ gfc_conv_subref_array_arg (gfc_se * parmse, gfc_expr * expr, int g77,
{
size = gfc_index_one_node;
offset = gfc_index_zero_node;
for (n = 0; n < info->dimen; n++)
for (n = 0; n < dimen; n++)
{
tmp = gfc_conv_descriptor_ubound_get (parmse->expr,
gfc_rank_cst[n]);