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

Поиск
Список
Период
Сортировка
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 по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Doc patch making firm recommendation for setting the value of commit_delay
Следующее
От: Xi Wang
Дата:
Сообщение: Re: [PATCH] Fix INT_MIN % -1 overflow in int8mod().