From 9d4335bd4fd803497183f4a41c4102d34d4d4ffc Mon Sep 17 00:00:00 2001 From: Emden Gansner Date: Thu, 22 Dec 2016 15:58:24 -0500 Subject: [PATCH] Don't use aptr->u.asym unless it has been set. This can cause a crash if aptr->u.asym->name is referenced. --- lib/cgraph/grammar.y | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/cgraph/grammar.y b/lib/cgraph/grammar.y index 6d83a9f91..90aa27387 100644 --- a/lib/cgraph/grammar.y +++ b/lib/cgraph/grammar.y @@ -352,6 +352,8 @@ static void attrstmt(int tkind, char *macroname) } bindattrs(kind); /* set up defaults for new attributes */ for (aptr = S->attrlist.first; aptr; aptr = aptr->next) { + /* If the tag is still T_atom, aptr->u.asym has not been set */ + if (aptr->tag == T_atom) continue; if (!(aptr->u.asym->fixed) || (S->g != G)) sym = agattr(S->g,kind,aptr->u.asym->name,aptr->str); else -- 2.40.0