Re: jsonapi: scary new warnings with LTO enabled

Поиск
Список
Период
Сортировка
От Jacob Champion
Тема Re: jsonapi: scary new warnings with LTO enabled
Дата
Msg-id CAOYmi+n7eShndhpJAZ-6+9h012nZfmuQbnj-p-L=ZnX96-PGVA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: jsonapi: scary new warnings with LTO enabled  (Daniel Gustafsson <daniel@yesql.se>)
Ответы Re: jsonapi: scary new warnings with LTO enabled
Список pgsql-hackers
On Mon, Apr 21, 2025 at 11:46 AM Daniel Gustafsson <daniel@yesql.se> wrote:
> We do, but with the current coding we call setJsonLexContextOwnsTokens
> immediately after creation which derefences the pointer without checkinf for
> allocation failure.

Right. (The flag does nothing on the OOM sentinel.)

> This means we dereference the pointer before we can check
> for an OOM return from pg_parse_json which even if safe seems to violate code
> readability no?

Personally, I'm fine with can't-fail APIs, as long as they're
documented as such. (I think the deferred error API was probably
chosen so that src/common JSON clients could be written without a lot
of pain?)

--Jacob



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