From: Marco Roeland <marco.roeland@xs4all.nl>
To: Nicolas Pitre <nico@cam.org>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: [PATCH] fix multiple issues in index-pack
Date: Mon, 20 Oct 2008 22:59:25 +0200 [thread overview]
Message-ID: <20081020205925.GA25524@fiberbit.xs4all.nl> (raw)
In-Reply-To: <alpine.LFD.2.00.0810201609300.26244@xanadu.home>
On Monday October 20th 2008 at 16:46 Nicolas Pitre wrote:
> Since commit 9441b61dc5, two issues affected correct behavior of
> index-pack:
>
> 1) The real_type of a delta object is the 'real_type' of its base, not
> the 'type' which can be a "delta type". Consequence of this is a
> corrupted pack index file which only needs to be recreated with a
> good index-pack command ('git verify-pack' will flag those).
>
> 2( The code sequence:
>
> result->data = patch_delta(get_base_data(base), base->obj->size,
> delta_data, delta_size, &result->size);
>
> has two issues of its own since base->obj->size should instead be
> base->size as we want the size of the actual object data and not
> the size of the delta object it is represented by. Except that
> simply replacing base->obj->size with base->size won't make the
> code more correct as the C language doesn't enforce a particular
> ordering for the evaluation of needed arguments for a function call,
> hence base->size could be pushed on the stack before get_base_data()
> which initializes base->size is called.
>
> Signed-off-by: Nicolas Pitre <nico@cam.org>
This patch works for me. Thanks and good detective work.
--
Marco Roeland
next prev parent reply other threads:[~2008-10-20 21:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-20 20:46 [PATCH] fix multiple issues in index-pack Nicolas Pitre
2008-10-20 20:56 ` Jeff King
2008-10-20 20:59 ` Marco Roeland [this message]
2008-10-20 21:31 ` Junio C Hamano
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=20081020205925.GA25524@fiberbit.xs4all.nl \
--to=marco.roeland@xs4all.nl \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=nico@cam.org \
/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).