Commit 05e6ff80 by Paul Thomas

re PR fortran/35864 (Revision 133965 broke gfortran.dg/initialization_1.f90)

2008-04-15  Paul Thomas  <pault@gcc.gnu.org>

	PR fortran/35864
	* expr.c (scalarize_intrinsic_call): Reorder identification of
	array argument so that if one is not found a segfault does not
	occur.  Return FAILURE if all scalar arguments.

From-SVN: r134329
parent 69c32ec8
2008-04-15 Paul Thomas <pault@gcc.gnu.org>
PR fortran/35864
* expr.c (scalarize_intrinsic_call): Reorder identification of
array argument so that if one is not found a segfault does not
occur. Return FAILURE if all scalar arguments.
2008-04-13 Jerry DeLisle <jvdelisle@gcc.gnu.org>
Tobias Burnus <burnus@net-b.de>
......
......@@ -1704,14 +1704,11 @@ scalarize_intrinsic_call (gfc_expr *e)
gfc_expr *expr, *old;
int n, i, rank[5], array_arg;
old = gfc_copy_expr (e);
/* Find which, if any, arguments are arrays. Assume that the old
expression carries the type information and that the first arg
that is an array expression carries all the shape information.*/
n = array_arg = 0;
a = old->value.function.actual;
a = e->value.function.actual;
for (; a; a = a->next)
{
n++;
......@@ -1723,7 +1720,9 @@ scalarize_intrinsic_call (gfc_expr *e)
}
if (!array_arg)
goto cleanup;
return FAILURE;
old = gfc_copy_expr (e);
gfc_free_constructor (expr->value.constructor);
expr->value.constructor = NULL;
......@@ -1763,7 +1762,7 @@ scalarize_intrinsic_call (gfc_expr *e)
}
/* Using the first argument as the master, step through the array
/* Using the array argument as the master, step through the array
calling the function for each element and advancing the array
constructors together. */
ctor = args[array_arg - 1];
......
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