diff options
author | Harald Anlauf <anlauf@gmx.de> | 2020-04-20 14:20:19 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2020-04-20 14:20:19 +0200 |
commit | aeb430aadc3c91af50095be924365981d85f8b8a (patch) | |
tree | 13752307651507dcf8f23ee6bda0f5aae86b49e2 /gcc/fortran | |
parent | 9b4d38df3f190311a4a5b5abb49ed97b1f60d46c (diff) | |
download | gcc-aeb430aadc3c91af50095be924365981d85f8b8a.zip gcc-aeb430aadc3c91af50095be924365981d85f8b8a.tar.gz gcc-aeb430aadc3c91af50095be924365981d85f8b8a.tar.bz2 |
PR fortran/93364 - ICE in gfc_set_array_spec, at fortran/array.c:879
Add missing check in gfc_set_array_spec for sum of rank and corank to not
exceed GFC_MAX_DIMENSIONS.
2020-04-20 Harald Anlauf <anlauf@gmx.de>
PR fortran/93364
* array.c (gfc_set_array_spec): Check for sum of rank and corank
not exceeding GFC_MAX_DIMENSIONS.
2020-04-20 Harald Anlauf <anlauf@gmx.de>
PR fortran/93364
* gfortran.dg/pr93364.f90: New test.
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/array.c | 4 |
2 files changed, 10 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 2671c1a..b783bfc 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2020-04-20 Harald Anlauf <anlauf@gmx.de> + + PR fortran/93364 + * array.c (gfc_set_array_spec): Check for sum of rank and corank + not exceeding GFC_MAX_DIMENSIONS. + 2020-04-20 Steve Kargl <kargl@gcc.gnu.org> Thomas Koenig <tkoenig@gcc.gnu.org> 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; |