From patchwork Mon Mar 29 07:50:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Li X-Patchwork-Id: 88920 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2T7oZMM003307 for ; Mon, 29 Mar 2010 07:50:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754749Ab0C2Hue (ORCPT ); Mon, 29 Mar 2010 03:50:34 -0400 Received: from mail-vw0-f46.google.com ([209.85.212.46]:44128 "EHLO mail-vw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754740Ab0C2Hue convert rfc822-to-8bit (ORCPT ); Mon, 29 Mar 2010 03:50:34 -0400 Received: by vws8 with SMTP id 8so2375917vws.19 for ; Mon, 29 Mar 2010 00:50:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:received:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=BPBj3NcHdASABlqlKnTdyVVR7nXdkdw1HCldRlQ3WFM=; b=uFK84v8akjJezjMIDMfQDk52az3EK3MsWoVimxGC6UI7FpmwlaWfBSLE3bWaQtzTA0 61g1CnGXrQHasDnB05QPgx3IdowUeVHJW+qtP7ewo+w7EJmmgPwblPS8vUR2Gn/vAv/+ sIW4k5KNA4Lg0rTZfvxgASN8WLPGfVGyOCP6s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=laUwf/WkGWgKkw0VSF6sfcrvdVVg+qWp0KrM7Cmbfb0/JmcgolLRC2SH0Rvmzb+yO7 ehwVeCOWl/1cyP1T8RpIz+SLuYDPXv7R67ja96Gig7ydAZybi3n+NBiQ4aiC1gRzi1Sp nLYydt+CsSBQVMtCiI8+AfN4w7akd9IeorsKA= MIME-Version: 1.0 Received: by 10.220.91.36 with HTTP; Mon, 29 Mar 2010 00:50:31 -0700 (PDT) In-Reply-To: <70318cbf1003251020j11ad7dd9m5e22b52699265526@mail.gmail.com> References: <20100324104144.0817c22b.rdunlap@xenotime.net> <20100324193622.GC4331@feather> <4BAA6C4C.8010103@xenotime.net> <20100324203427.GA3015@feather> <20100325104947.GC5069@bicker> <20100325154614.GD30147@feather> <4BAB8F36.2090600@xenotime.net> <70318cbf1003251020j11ad7dd9m5e22b52699265526@mail.gmail.com> Date: Mon, 29 Mar 2010 00:50:31 -0700 X-Google-Sender-Auth: 6df8bdf66e5dcabc Received: by 10.220.107.22 with SMTP id z22mr2817016vco.183.1269849031903; Mon, 29 Mar 2010 00:50:31 -0700 (PDT) Message-ID: <70318cbf1003290050x7f15655ra07edba3668eb4a3@mail.gmail.com> Subject: Re: segfault in sparse snapshot 2010-02-13 From: Christopher Li To: Randy Dunlap Cc: Josh Triplett , Dan Carpenter , linux-sparse@vger.kernel.org Sender: linux-sparse-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sparse@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Mon, 29 Mar 2010 07:50:35 +0000 (UTC) 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; }