diff options
author | Harald Anlauf <anlauf@gmx.de> | 2020-06-28 16:24:15 +0200 |
---|---|---|
committer | Harald Anlauf <anlauf@gmx.de> | 2020-06-28 16:24:15 +0200 |
commit | b62cac6d92ff251213753475b69ec0b269cb7fae (patch) | |
tree | 20f04a663bf0818890729cdd79e1dd2357cfb2df /gcc/fortran/match.c | |
parent | 06ed4aae1c2fa84b7050a286d866db4a6def3c36 (diff) | |
download | gcc-b62cac6d92ff251213753475b69ec0b269cb7fae.zip gcc-b62cac6d92ff251213753475b69ec0b269cb7fae.tar.gz gcc-b62cac6d92ff251213753475b69ec0b269cb7fae.tar.bz2 |
PR fortran/95340 - ICE in gfc_match_select_rank, at fortran/match.c:6690
Do not dereference NULL pointer when querying array shape of possibly
improperly delared variable.
gcc/fortran/
PR fortran/95340
* match.c (gfc_match_select_rank): Do not dereference NULL pointer.
Diffstat (limited to 'gcc/fortran/match.c')
-rw-r--r-- | gcc/fortran/match.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/fortran/match.c b/gcc/fortran/match.c index b011634..db5174f 100644 --- a/gcc/fortran/match.c +++ b/gcc/fortran/match.c @@ -6695,7 +6695,8 @@ gfc_match_select_rank (void) if (expr1->symtree) { sym = expr1->symtree->n.sym; - as = sym->ts.type == BT_CLASS ? CLASS_DATA (sym)->as : sym->as; + as = (sym->ts.type == BT_CLASS + && CLASS_DATA (sym)) ? CLASS_DATA (sym)->as : sym->as; } if (expr1->expr_type != EXPR_VARIABLE |