Commit 89010691 by Mikael Morin Committed by Mikael Morin

expr.c (gfc_get_corank): Return 0 if input expression is not a coarray.

	* expr.c (gfc_get_corank): Return 0 if input expression is not a
	coarray.

From-SVN: r179675
parent bb033c9a
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* expr.c (gfc_get_corank): Return 0 if input expression is not a
coarray.
2011-10-07 Mikael Morin <mikael.morin@sfr.fr>
* trans-array.c (gfc_conv_expr_descriptor): Simplify coarray
descriptor setup code.
......
......@@ -4301,13 +4301,19 @@ gfc_get_corank (gfc_expr *e)
{
int corank;
gfc_ref *ref;
if (!gfc_is_coarray (e))
return 0;
corank = e->symtree->n.sym->as ? e->symtree->n.sym->as->corank : 0;
for (ref = e->ref; ref; ref = ref->next)
{
if (ref->type == REF_ARRAY)
corank = ref->u.ar.as->corank;
gcc_assert (ref->type != REF_SUBSTRING);
}
return corank;
}
......
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