commit 4d7df9aec7dbb3410098e867dc803811dde5a5c6
Author: Akim Demaille <[email protected]>
Date:   Sat Dec 29 09:19:45 2018 +0100

    symbol: don't crash on symbol without content
    
    When running with --trace=parse, we may crash.
    
    * src/symtab.c (symbol_print): Avoid that.

diff --git a/src/symtab.c b/src/symtab.c
index 9dbc79f6..2409f41c 100644
--- a/src/symtab.c
+++ b/src/symtab.c
@@ -210,11 +210,11 @@ semantic_type_new (uniqstr tag, const location *loc)
 `-----------------*/
 
 #define SYMBOL_ATTR_PRINT(Attr)                         \
-  if (s->content->Attr)                                 \
+  if (s->content && s->content->Attr)                   \
     fprintf (f, " %s { %s }", #Attr, s->content->Attr)
 
 #define SYMBOL_CODE_PRINT(Attr)                                         \
-  if (s->content->props[Attr].code)                                     \
+  if (s->content && s->content->props[Attr].code)                       \
     fprintf (f, " %s { %s }", #Attr, s->content->props[Attr].code)
 
 void


Reply via email to