diff options
Diffstat (limited to 'gcc/fortran/trans-array.c')
-rw-r--r-- | gcc/fortran/trans-array.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index c346183..478cddd 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -1167,8 +1167,11 @@ get_class_info_from_ss (stmtblock_t * pre, gfc_ss *ss, tree *eltype) && rhs_ss->info->expr->ts.type == BT_CLASS && rhs_ss->info->data.array.descriptor) { - rhs_class_expr - = gfc_get_class_from_expr (rhs_ss->info->data.array.descriptor); + if (rhs_ss->info->expr->expr_type != EXPR_VARIABLE) + rhs_class_expr + = gfc_get_class_from_expr (rhs_ss->info->data.array.descriptor); + else + rhs_class_expr = gfc_get_class_from_gfc_expr (rhs_ss->info->expr); unlimited_rhs = UNLIMITED_POLY (rhs_ss->info->expr); if (rhs_ss->info->expr->expr_type == EXPR_FUNCTION) rhs_function = true; @@ -6159,7 +6162,7 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) case EXPR_ARRAY: /* Create a vector of all the elements. */ for (c = gfc_constructor_first (expr->value.constructor); - c; c = gfc_constructor_next (c)) + c && c->expr; c = gfc_constructor_next (c)) { if (c->iterator) { |