From 703499e552b45542a328e3016868419d65143f2b Mon Sep 17 00:00:00 2001 From: Christopher Date: Sun, 28 Mar 2010 22:41:49 -0700 Subject: evaluate: check for NULL type inside typeof This should fix the segfault report by Randy. It still doesn't parse the struct attribute correctly though. Signed-off-by: Christopher --- evaluate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 symbol **base) 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; } if (type->type == SYM_ENUM) -- cgit v1.2.3-65-gdbad