Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().
| От | Tom Lane |
|---|---|
| Тема | Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod(). |
| Дата | |
| Msg-id | 26733.1352929598@sss.pgh.pa.us обсуждение исходный текст |
| Ответ на | [PATCH] Fix INT_MIN % -1 overflow in int8mod(). (Xi Wang <xi.wang@gmail.com>) |
| Ответы |
Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().
[PATCH 1/2] Fix INT_MIN % -1 overflow in int8mod(). [PATCH 2/2] Clean up INT_MIN % -1 overflow in int4mod(). |
| Список | pgsql-hackers |
Xi Wang <xi.wang@gmail.com> writes:
> Return 0 for INT_MIN % -1 (64-bit) instead of throwing an exception.
> This patch complements commit f9ac414c that fixed int4mod().
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.
regards, tom lane
В списке pgsql-hackers по дате отправления: