|
|
|
Re: segfault in sparse snapshot 2010-02-13 | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On Mon, 29 Mar 2010 00:50:31 -0700 Christopher Li wrote:
> 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.
Hi Chris,
Yes, this gets it past the segfault problem. Thanks.
[Just had a little trouble applying it because it's full of spaces
instead of tabs. Once I realized that, it was no problem.]
---
~Randy
--
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
[Newbies FAQ] [Kernel List] [Site Home] [IETF Annouce] [DCCP] [Netdev] [Networking] [Security] [Bugtraq] [Photo] [Yosemite] [MIPS Linux] [ARM Linux] [Linux Security] [Linux RAID] [Linux SCSI] [DDR & Rambus] [Trinity Fuzzer Tool]