Re: 64-bit integer subtraction bug on some platforms

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: 64-bit integer subtraction bug on some platforms
Дата
Msg-id 685674.1699459685@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: 64-bit integer subtraction bug on some platforms  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-hackers
Laurenz Albe <laurenz.albe@cybertec.at> writes:
> On Wed, 2023-11-08 at 11:58 +0000, Dean Rasheed wrote:
>> This should overflow, since the correct result (+9223372036854775808)
>> is out of range. However, on platforms without integer overflow
>> builtins or 128-bit integers, pg_sub_s64_overflow() does the
>> following:
>> ...
>> which fails to spot the fact that overflow is also possible when a ==
>> 0. So on such platforms, it returns the wrong result.
>> 
>> Patch attached.

> The patch looks good to me.

+1: good catch, fix looks correct.

            regards, tom lane



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

Предыдущее
От: "Tristan Partin"
Дата:
Сообщение: Re: Fix use of openssl.path() if openssl isn't found
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Call pqPipelineFlush from PQsendFlushRequest