From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: Re: [PATCH 16/16] fix handling of integer constant expressions Date: Wed, 27 Jun 2007 07:50:18 -0700 Message-ID: <1182955818.8970.28.camel@josh-work.beaverton.ibm.com> References: <20070624183547.GA21478@ftp.linux.org.uk> <1a25667a20e43a072f733a3ec2b8e79d@kernel.crashing.org> <20070624203837.GE21478@ftp.linux.org.uk> <467F531A.3030702@freedesktop.org> <20070626221040.GI21478@ftp.linux.org.uk> <20070626221134.GA21350@ftp.linux.org.uk> <20070627121021.GQ7590@daikokuya.co.uk> <20070627123031.GO21478@ftp.linux.org.uk> <20070627125958.GA16758@daikokuya.co.uk> <20070627131823.GR21478@ftp.linux.org.uk> Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit Return-path: Received: from e31.co.us.ibm.com ([32.97.110.149]:37726 "EHLO e31.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755779AbXF0OuX (ORCPT ); Wed, 27 Jun 2007 10:50:23 -0400 In-Reply-To: <20070627131823.GR21478@ftp.linux.org.uk> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Al Viro Cc: Neil Booth , Josh Triplett , Segher Boessenkool , Linus Torvalds , linux-kernel@vger.kernel.org, linux-sparse@vger.kernel.org On Wed, 2007-06-27 at 14:18 +0100, Al Viro wrote: > --- a/expand.c > +++ b/expand.c [...] > @@ -488,12 +490,15 @@ static int expand_conditional(struct expression *expr) > > cond_cost = expand_expression(cond); > if (cond->type == EXPR_VALUE) { > + unsigned flags = expr->flags; > if (!cond->value) > true = false; > if (!true) > true = cond; > + cost = expand_expression(*true); > *expr = *true; > - return expand_expression(expr); > + expr->flags = flags; > + return cost; This passes an incorrect type to expand_expression; it wants a struct expression *, but *true has type struct expression; did you want to pass true rather than *true? - Josh Triplett