Linux SPARSE checker discussions
 help / color / mirror / Atom feed
From: Ramsay Jones <ramsay@ramsayjones.plus.com>
To: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>,
	linux-sparse@vger.kernel.org
Subject: Re: [PATCH] univ-init: scalar initializer needs some additional checks
Date: Wed, 3 Jun 2020 14:47:04 +0100	[thread overview]
Message-ID: <99851c7e-e96a-aa5d-9184-d6e17e31e3d3@ramsayjones.plus.com> (raw)
In-Reply-To: <34e42c7f-6c9d-b8e5-6ee1-2988b1099176@ramsayjones.plus.com>



On 03/06/2020 02:01, Ramsay Jones wrote:

> On 02/06/2020 17:33, Luc Van Oostenryck wrote:
[snip]
> 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.
> 
> The only thing which gave me pause ...
> 
>> Fixes: 537e3e2daebd37d69447e65535fc94e82b38fc18
>> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
>> ---
>>  evaluate.c                 |  3 +++
>>  expression.h               |  1 +
>>  parse.c                    | 15 ++++++++-------
>>  validation/Wuniv-init-ko.c | 16 ++++++++++++++++
>>  validation/Wuniv-init-ok.c | 18 ++++++++++++++++++
>>  5 files changed, 46 insertions(+), 7 deletions(-)
>>
>> 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!).

Heh, as soon as my head hit the pillow I realised that, due to extensive
use of memory pools/arenas, this is a rather silly comment! ;-)

[Ah, well, it was 2am!]

ATB,
Ramsay Jones

  reply	other threads:[~2020-06-03 13:47 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 [this message]
2020-06-03 21:16   ` Luc Van Oostenryck

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=99851c7e-e96a-aa5d-9184-d6e17e31e3d3@ramsayjones.plus.com \
    --to=ramsay@ramsayjones.plus.com \
    --cc=linux-sparse@vger.kernel.org \
    --cc=luc.vanoostenryck@gmail.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