projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e6a5daa
)
PR fortran/78746 - invalid access after error recovery
author
Harald Anlauf
<anlauf@gmx.de>
Wed, 6 Jan 2021 18:37:11 +0000
(19:37 +0100)
committer
Harald Anlauf
<anlauf@gmx.de>
Wed, 6 Jan 2021 18:37:11 +0000
(19:37 +0100)
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.
gcc/fortran/resolve.c
patch
|
blob
|
history
diff --git
a/gcc/fortran/resolve.c
b/gcc/fortran/resolve.c
index fa6f756d2859bad9bf003898d2459e6b7e10fc90..1fac183e2006b35a92e30e9de2eb7d3f3393700c 100644
(file)
--- 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);