pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Daniel Gustafsson <dgustafsson@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Allocate JsonLexContexts on the heap to avoid warnings
Date: Wed, 23 Apr 2025 09:25:38 +0000
Message-ID: <E1u7WMM-001NxG-1Q@gemulon.postgresql.org> (raw)

Allocate JsonLexContexts on the heap to avoid warnings

The stack allocated JsonLexContexts, in combination with codepaths
using goto, were causing warnings when compiling with LTO enabled
as the optimizer is unable to figure out that is safe.  Rather than
contort the code with workarounds for this simply heap allocate the
structs instead as these are not in any performance critical paths.

Author: Daniel Gustafsson <daniel@yesql.se>
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Reviewed-by: Jacob Champion <jacob.champion@enterprisedb.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/2074634.1744839761@sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/994a100b37ad8c2fb8282a9fce91a16b4c832277

Modified Files
--------------
src/interfaces/libpq/fe-auth-oauth.c               | 12 +++++------
.../test_json_parser_incremental.c                 | 23 +++++++++++++---------
2 files changed, 20 insertions(+), 15 deletions(-)



Message-ID: <E1u7WMM-001NxG-1Q@gemulon.postgresql.org>
Permalink:  ../E1u7WMM-001NxG-1Q@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u7WMM-001NxG-1Q@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: dgustafsson@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Allocate JsonLexContexts on the heap to avoid warnings
  In-Reply-To: <E1u7WMM-001NxG-1Q@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox