diff options
Diffstat (limited to 'gcc/fortran/array.c')
-rw-r--r-- | gcc/fortran/array.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/fortran/array.c b/gcc/fortran/array.c index 57972bc..471523f 100644 --- a/gcc/fortran/array.c +++ b/gcc/fortran/array.c @@ -864,6 +864,10 @@ gfc_set_array_spec (gfc_symbol *sym, gfc_array_spec *as, locus *error_loc) return false; } + /* Check F2018:C822. */ + if (sym->as->rank + sym->as->corank > GFC_MAX_DIMENSIONS) + goto too_many; + if (as->corank) { sym->as->cotype = as->cotype; |