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
This commit is contained in:
parent
bb033c9adc
commit
89010691e4
|
@ -1,3 +1,8 @@
|
|||
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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue