Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
To: Ramsay Jones <ramsay@ramsayjones.plus.com>
Cc: linux-sparse@vger.kernel.org
Subject: Re: [PATCH] univ-init: scalar initializer needs some additional checks
Date: Wed, 3 Jun 2020 23:16:35 +0200	[thread overview]
Message-ID: <20200603211635.ufhlujbchvlhbhib@ltop.local> (raw)
In-Reply-To: <34e42c7f-6c9d-b8e5-6ee1-2988b1099176@ramsayjones.plus.com>

On Wed, Jun 03, 2020 at 02:01:07AM +0100, Ramsay Jones wrote:
> 
> I applied this patch just now and everything worked fine. In addition,
> the tests from my patch also passed, once I had remembered to add the
> -Wno-universal-initializer to the 'check-command' - because I do not
> have the patch which changes the default for that warning.

I should have added that this patch was meant to be applied before
the one for the default :(
 
> The only thing which gave me pause ...
> 
> > diff --git a/evaluate.c b/evaluate.c
> > index 8d2e68692a48..16553eb3481b 100644
> > --- a/evaluate.c
> > +++ b/evaluate.c
> > @@ -2608,6 +2608,9 @@ static void handle_list_initializer(struct expression *expr,
> >  	struct expression *e, *last = NULL, *top = NULL, *next;
> >  	int jumped = 0;
> >  
> > +	if (expr->zero_init)
> > +		expr->expr_list = NULL;
> 
> ... was the potential memory leak here. (OK it wouldn't be a
> huge leak, but still!).

Well yes [replying to your other mail too). It doesn't matter much here
but it's also easy to free the list, which is what I've done.

Thanks for giving a look at all of this.
Both patches are now applied.
-- Luc

      parent reply	other threads:[~2020-06-03 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-02 16:33 [PATCH] univ-init: scalar initializer needs some additional checks Luc Van Oostenryck
2020-06-03  1:01 ` Ramsay Jones
2020-06-03 13:47   ` Ramsay Jones
2020-06-03 21:16   ` Luc Van Oostenryck [this message]

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=20200603211635.ufhlujbchvlhbhib@ltop.local \
    --to=luc.vanoostenryck@gmail.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=ramsay@ramsayjones.plus.com \
    /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