aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/resolve.c
diff options
context:
space:
mode:
authorHarald Anlauf <anlauf@gmx.de>2021-01-06 19:37:11 +0100
committerHarald Anlauf <anlauf@gmx.de>2021-01-06 19:37:11 +0100
commit8b6f1e8f97fe0d435d334075821149dbd85c8266 (patch)
tree706ebdc753411b95fb86b12001b783cd6438ac37 /gcc/fortran/resolve.c
parente6a5daae7ec5318c3949432d92b7f674dab5241d (diff)
downloadgcc-8b6f1e8f97fe0d435d334075821149dbd85c8266.zip
gcc-8b6f1e8f97fe0d435d334075821149dbd85c8266.tar.gz
gcc-8b6f1e8f97fe0d435d334075821149dbd85c8266.tar.bz2
PR fortran/78746 - invalid access after error recovery
The error recovery after an invalid reference to an undefined CLASS during a TYPE declaration lead to an invalid access. Add a check. gcc/fortran/ChangeLog: * resolve.c (resolve_component): Add check for valid CLASS reference before trying to access CLASS data.
Diffstat (limited to 'gcc/fortran/resolve.c')
-rw-r--r--gcc/fortran/resolve.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index fa6f756..1fac183 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -14384,7 +14384,7 @@ resolve_component (gfc_component *c, gfc_symbol *sym)
/* F2008, C448. */
if (c->ts.type == BT_CLASS)
{
- if (CLASS_DATA (c))
+ if (c->attr.class_ok && CLASS_DATA (c))
{
attr = &(CLASS_DATA (c)->attr);