Re: [PATCH 1/3] Fix x + y < x overflow checks

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Xi Wang <xi(dot)wang(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: [PATCH 1/3] Fix x + y < x overflow checks
Date: 2013-01-25 15:44:31
Message-ID: CA+TgmoYoOexFwRrewLcFvr+=J7b8hkdodRXS_Zp+j_vAXa1spA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 24, 2013 at 4:36 AM, Xi Wang <xi(dot)wang(at)gmail(dot)com> wrote:
> icc optimizes away the overflow check x + y < x (y > 0), because
> signed integer overflow is undefined behavior in C. Instead, use
> a safe precondition test x > INT_MAX - y.

As you post these patches, please add them to:

https://commitfest.postgresql.org/action/commitfest_view/open

This will ensure that they (eventually) get looked at.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2013-01-25 15:49:25 Re: autovacuum not prioritising for-wraparound tables
Previous Message Robert Haas 2013-01-25 15:42:24 Re: Event Triggers: adding information