avoid negating LONG_MIN in cash_out()

Поиск
Список
Период
Сортировка
От Zhihong Yu
Тема avoid negating LONG_MIN in cash_out()
Дата
Msg-id CALNJ-vTVL6JKvEjHOnNxp50r8Tx6meKJ=GdP3ACwVOOkXhudLQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: avoid negating LONG_MIN in cash_out()
Список pgsql-hackers
Hi,
In cash_out(), we have the following code:

    if (value < 0)
    {
        /* make the amount positive for digit-reconstruction loop */
        value = -value;

The negation cannot be represented in type long when the value is LONG_MIN.
It seems we can error out when LONG_MIN is detected instead of continuing with computation.

Please take a look at the patch and provide your feedback.

Thanks

Вложения

В списке pgsql-hackers по дате отправления: