On Thu, Mar 25, 2010 at 10:20 AM, Christopher Li <sparse@xxxxxxxxxxx> wrote: > On Thu, Mar 25, 2010 at 9:28 AM, Randy Dunlap <rdunlap@xxxxxxxxxxxx> wrote: >> >> OK, I emailed that file, but it's huge -- it probably won't be on the >> mailing list, so I also uploaded it to here: >> http://www.xenotime.net/linux/doc/br_fdb.i > > Thanks, I can duplicate the segfault now. > > Looking at it. Hi, I check in a change at. commit 703499e552b45542a328e3016868419d65143f2b Author: Christopher <sparse@xxxxxxxxxxx> Date: Sun Mar 28 22:41:49 2010 -0700 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 <sparse@xxxxxxxxxxx> 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; } if (type->type == SYM_ENUM) That should stop the segfault. Please verify. More work needs to be done to parse the struct attribute correctly. Chris -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html