Allocate JsonLexContexts on the heap to avoid warnings
authorDaniel Gustafsson <[email protected]>
Wed, 23 Apr 2025 09:02:05 +0000 (11:02 +0200)
committerDaniel Gustafsson <[email protected]>
Wed, 23 Apr 2025 09:02:05 +0000 (11:02 +0200)
commit994a100b37ad8c2fb8282a9fce91a16b4c832277
treeb08a5e1e17d950c431d6b8c1c4ba3b84a1e81d83
parent0ff95e0a5be1372bfba9db284ea17c8e0e5da3a0
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 <[email protected]>
Reported-by: Tom Lane <[email protected]>
Reviewed-by: Jacob Champion <[email protected]>
Reviewed-by: Tom Lane <[email protected]>
Discussion: https://postgr.es/m/2074634.1744839761@sss.pgh.pa.us
src/interfaces/libpq/fe-auth-oauth.c
src/test/modules/test_json_parser/test_json_parser_incremental.c