Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().

From: Xi Wang <xi(dot)wang(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().
Date: 2012-11-14 21:54:46
Message-ID: 50A41326.6040309@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/14/12 4:46 PM, Tom Lane wrote:
> Meh. I didn't care for the explicit dependency on INT_MIN in the
> previous patch, and I like introducing INT64_MIN even less. I think
> we should be able to reduce the test to just
>
> if (arg2 == -1)
> return 0;
>
> since zero is the correct result for any value of arg1, not only
> INT_MIN.

I agree. Will send a v2. Thanks. :)

- xi

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-11-14 22:03:07 Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().
Previous Message Tom Lane 2012-11-14 21:46:38 Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().