From: Erik Faye-Lund <kusmabite@gmail.com>
To: Nicolas Pitre <nico@fluxnic.net>
Cc: git@vger.kernel.org, jrnieder@gmail.com
Subject: Re: [PATCH v3] do not depend on signed integer overflow
Date: Tue, 5 Oct 2010 09:26:26 +0200 [thread overview]
Message-ID: <AANLkTimdaghq5_vcb+7Anh_05oLJUbZuNXU47YWdBudq@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1010050012490.3107@xanadu.home>
On Tue, Oct 5, 2010 at 6:17 AM, Nicolas Pitre <nico@fluxnic.net> wrote:
> On Tue, 5 Oct 2010, Erik Faye-Lund wrote:
>
>> Signed integer overflow is not defined in C, so do not depend on it.
>>
>> This fixes a problem with GCC 4.4.0 and -O3 where the optimizer would
>> consider "consumed_bytes > consumed_bytes + bytes" as a constant
>> expression, and never execute the die()-call.
>>
>> Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
>
> I like this. Please also fix the similar case in
> builtin/pack-objects.c:write_one().
>
Thanks for pointing that one out. For some reason GCC didn't warn
about that instance - perhaps it's optimizer missed the case due to
going through that pointer?
I've just resent a version with that fix-up.
prev parent reply other threads:[~2010-10-05 7:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-04 22:49 [PATCH v3] do not depend on signed integer overflow Erik Faye-Lund
2010-10-05 3:43 ` Jeff King
2010-10-05 4:17 ` Nicolas Pitre
2010-10-05 7:26 ` Erik Faye-Lund [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=AANLkTimdaghq5_vcb+7Anh_05oLJUbZuNXU47YWdBudq@mail.gmail.com \
--to=kusmabite@gmail.com \
--cc=git@vger.kernel.org \
--cc=jrnieder@gmail.com \
--cc=nico@fluxnic.net \
/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).