Before testing the kind of an entity, make sure we got an entity at all.
authorChristoph Mallon <christoph.mallon@gmx.de>
Wed, 4 Feb 2009 12:58:10 +0000 (12:58 +0000)
committerChristoph Mallon <christoph.mallon@gmx.de>
Wed, 4 Feb 2009 12:58:10 +0000 (12:58 +0000)
[r25424]

parser.c

index 611574c..f25927a 100644 (file)
--- a/parser.c
+++ b/parser.c
@@ -4194,6 +4194,8 @@ static bool has_parameters(void)
        /* func(void) is not a parameter */
        if (token.type == T_IDENTIFIER) {
                entity_t const *const entity = get_entity(token.v.symbol, NAMESPACE_NORMAL);
+               if (entity == NULL)
+                       return true;
                if (entity->kind != ENTITY_TYPEDEF)
                        return true;
                if (skip_typeref(entity->typedefe.type) != type_void)