Re: Fix bogus use of "long" in aset.c

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Fix bogus use of "long" in aset.c
Дата
Msg-id 2927305.1761783886@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Fix bogus use of "long" in aset.c  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Fix bogus use of "long" in aset.c
Список pgsql-hackers
David Rowley <dgrowleyml@gmail.com> writes:
> On Thu, 30 Oct 2025 at 12:55, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Seems like it's important that the value be signed, so maybe ssize_t?
>> Or ptrdiff_t?

> The reason I left it an unsigned type was that the check is doing: if
> (chsize + ALLOC_CHUNKHDRSZ != blk_used), so we'd still catch this with
> an unsigned type, even if it wrapped due to going negative due to a
> bogus freeptr. Changing to a signed type would leave us with a few
> tests comparing signed to unsigned types.

Yeah, that's fair.  I'm content with what you have.

            regards, tom lane



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