From: Randy Dunlap <rdunlap@xenotime.net>
To: Christopher Li <sparse@chrisli.org>
Cc: Josh Triplett <josh@joshtriplett.org>,
Dan Carpenter <error27@gmail.com>,
linux-sparse@vger.kernel.org
Subject: Re: segfault in sparse snapshot 2010-02-13
Date: Mon, 29 Mar 2010 09:46:42 -0700 [thread overview]
Message-ID: <20100329094642.ff0a2e8b.rdunlap@xenotime.net> (raw)
In-Reply-To: <70318cbf1003290050x7f15655ra07edba3668eb4a3@mail.gmail.com>
On Mon, 29 Mar 2010 00:50:31 -0700 Christopher Li wrote:
> On Thu, Mar 25, 2010 at 10:20 AM, Christopher Li <sparse@chrisli.org> wrote:
> > On Thu, Mar 25, 2010 at 9:28 AM, Randy Dunlap <rdunlap@xenotime.net> 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@chrisli.org>
> 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@chrisli.org>
>
> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2010-03-29 16:46 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-24 17:41 segfault in sparse snapshot 2010-02-13 Randy Dunlap
2010-03-24 19:36 ` Josh Triplett
[not found] ` <4BAA6C4C.8010103@xenotime.net>
2010-03-24 20:34 ` Josh Triplett
2010-03-24 21:01 ` Randy Dunlap
2010-03-24 22:00 ` Josh Triplett
2010-03-24 22:02 ` Randy Dunlap
2010-03-25 10:49 ` Dan Carpenter
2010-03-25 15:46 ` Josh Triplett
2010-03-25 16:28 ` Randy Dunlap
2010-03-25 17:20 ` Christopher Li
2010-03-29 7:50 ` Christopher Li
2010-03-29 16:46 ` Randy Dunlap [this message]
2010-03-29 17:29 ` Christopher Li
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100329094642.ff0a2e8b.rdunlap@xenotime.net \
--to=rdunlap@xenotime.net \
--cc=error27@gmail.com \
--cc=josh@joshtriplett.org \
--cc=linux-sparse@vger.kernel.org \
--cc=sparse@chrisli.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).