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.
This commit is contained in:
Harald Anlauf 2021-01-06 19:37:11 +01:00
parent e6a5daae7e
commit 8b6f1e8f97

View File

@ -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);