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

From Xi Wang
Subject Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().
Date
Msg-id 50A41326.6040309@gmail.com
Whole thread Raw
In response to Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().  (Tom Lane <tgl@sss.pgh.pa.us>)
List 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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().