linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christopher Li <sparse@chrisli.org>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Sparse <linux-sparse@vger.kernel.org>,
	Josh Triplett <josh@freedesktop.org>
Subject: [PATCH] Re: Sparse just seg faulted on me!
Date: Wed, 14 Feb 2007 09:29:05 -0800	[thread overview]
Message-ID: <20070214172905.GA17959@chrisli.org> (raw)
In-Reply-To: <9C17AC42-0C51-44D9-B126-1FB781DE0ECA@cam.ac.uk>

> fs/ntfs/sysctl.c:38:15: error: undefined identifier 'CTL_UNNUMBRED'
Sparse left empty ctype when error happen. Sparse should skip
the expand_symbol() at all if error happen. 

Please try this patch:

Fix the segfault when initializer has unknown symbol

Signed-Off-By: Christopher Li <sparse@chrisli.org>

Index: sparse/expand.c
===================================================================
--- sparse.orig/expand.c	2007-02-14 09:28:57.000000000 -0800
+++ sparse/expand.c	2007-02-14 09:44:59.000000000 -0800
@@ -872,7 +872,7 @@ static void verify_nonoverlapping(struct
 	struct expression *b;
 
 	FOR_EACH_PTR(*list, b) {
-		if (a && a->ctype->bit_size && bit_offset(a) == bit_offset(b)) {
+		if (a && a->ctype && a->ctype->bit_size && bit_offset(a) == bit_offset(b)) {
 			sparse_error(a->pos, "Initializer entry defined twice");
 			info(b->pos, "  also defined here");
 			return;

  reply	other threads:[~2007-02-14 17:58 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-14  9:04 Sparse just seg faulted on me! Anton Altaparmakov
2007-02-14 17:29 ` Christopher Li [this message]
2007-02-14 18:24   ` [PATCH] " Linus Torvalds
2007-02-14 19:54     ` Christopher Li
2007-02-14 20:18       ` Christopher Li
2007-02-23  2:25         ` Josh Triplett
2007-02-14 20:48       ` Linus Torvalds
2007-02-14 20:36         ` Christopher Li
2007-02-23  2:42   ` Josh Triplett

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=20070214172905.GA17959@chrisli.org \
    --to=sparse@chrisli.org \
    --cc=aia21@cam.ac.uk \
    --cc=josh@freedesktop.org \
    --cc=linux-sparse@vger.kernel.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).