From: Phillip Wood <phillip.wood@talktalk.net>
To: Stefan Beller <sbeller@google.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Cc: git <git@vger.kernel.org>, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 1/5] diff --color-moved-ws: fix double free crash
Date: Wed, 3 Oct 2018 10:38:48 +0100 [thread overview]
Message-ID: <1c6b26a2-45ca-df76-8baa-61790cb963ac@talktalk.net> (raw)
In-Reply-To: <CAGZ79kYqACgoNShaPBQQSUN1B_dhmdxHxBV6YZoNAd39f6XMjw@mail.gmail.com>
Hi Stefan
Thanks for looking at these patches
On 02/10/2018 19:49, Stefan Beller wrote:
> On Tue, Oct 2, 2018 at 10:55 AM Phillip Wood <phillip.wood@talktalk.net> wrote:
>
>> The solution is to store the ws_delta in the array of potential moved
>> blocks rather than with the lines. This means that it no longer needs
>> to be copied around and one block cannot overwrite the ws_delta of
>> another. Additionally it saves some malloc/free calls as we don't keep
>> allocating and freeing ws_deltas.
>
> Another solution would be to duplicate the copy-arounds, that it only
> fixes the double free, but having another layer of abstraction
> (moved block vs line) makes sense as then we don't need to copy
> it forward.
>
> With this patch applied the diff as mentioned works and having the
> ws deltas with the blocks instead of the
>
>>
>> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
>
>
>
>> static void pmb_advance_or_null_multi_match(struct diff_options *o,
> [...]
>> for (i = 0; i < pmb_nr; i++) {
>> if (got_match[i]) {
>> /* Carry the white space delta forward */
>
> I would think this comment is obsolete as well with this patch?
Yes you're right I should have removed that. As there are some changes
needed to some other comments I'll re-roll
Best Wishes
Phillip
>
> With or without that nit addressed, this patch is
> Reviewed-by: Stefan Beller <sbeller@google.com>
>
next prev parent reply other threads:[~2018-10-03 9:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-02 17:55 [PATCH 1/5] diff --color-moved-ws: fix double free crash Phillip Wood
2018-10-02 17:55 ` [PATCH 2/5] diff --color-moved-ws: fix out of bounds string access Phillip Wood
2018-10-02 18:58 ` Stefan Beller
2018-10-03 9:40 ` Phillip Wood
2018-10-02 17:55 ` [PATCH 3/5] diff --color-moved-ws: fix a memory leak Phillip Wood
2018-10-02 19:08 ` Stefan Beller
2018-10-03 9:42 ` Phillip Wood
2018-10-03 9:54 ` Martin Ågren
2018-10-02 17:55 ` [PATCH 4/5] diff --color-moved-ws: fix another " Phillip Wood
2018-10-02 19:08 ` Stefan Beller
2018-10-02 17:55 ` [PATCH 5/5] diff --color-moved: fix a " Phillip Wood
2018-10-02 19:11 ` Stefan Beller
2018-10-02 18:49 ` [PATCH 1/5] diff --color-moved-ws: fix double free crash Stefan Beller
2018-10-03 9:38 ` Phillip Wood [this message]
2018-10-04 10:07 ` [PATCH v2 0/5] " Phillip Wood
2018-10-04 10:07 ` [PATCH v2 1/5] " Phillip Wood
2018-10-04 10:07 ` [PATCH v2 2/5] diff --color-moved-ws: fix out of bounds string access Phillip Wood
2018-10-04 10:07 ` [PATCH v2 3/5] diff --color-moved-ws: fix a memory leak Phillip Wood
2018-10-04 10:07 ` [PATCH v2 4/5] diff --color-moved-ws: fix another " Phillip Wood
2018-10-04 10:07 ` [PATCH v2 5/5] diff --color-moved: fix a " Phillip Wood
2018-10-04 19:42 ` Stefan Beller
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=1c6b26a2-45ca-df76-8baa-61790cb963ac@talktalk.net \
--to=phillip.wood@talktalk.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=phillip.wood@dunelm.org.uk \
--cc=sbeller@google.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;
as well as URLs for NNTP newsgroup(s).