diff mbox

segfault in sparse snapshot 2010-02-13

Message ID 70318cbf1003290050x7f15655ra07edba3668eb4a3@mail.gmail.com (mailing list archive)
State Mainlined, archived
Headers show

Commit Message

Christopher Li March 29, 2010, 7:50 a.m. UTC
None
diff mbox

Patch

diff --git a/evaluate.c b/evaluate.c
index 28bfd7c..cdbd064 100644
--- a/evaluate.c
+++ b/evaluate.c
@@ -340,7 +340,9 @@  static inline int classify_type(struct symbol
*type, struct sy
                type = type->ctype.base_type;
        if (type->type == SYM_TYPEOF) {
                type = evaluate_expression(type->initializer);
-               if (type->type == SYM_NODE)
+               if (!type)
+                       type = &bad_ctype;
+               else if (type->type == SYM_NODE)
                        type = type->ctype.base_type;
        }