Allocate JsonLexContexts on the heap to avoid warnings
Daniel Gustafsson <dgustafsson@postgresql.org>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/interfaces/libpq/fe-auth-oauth.c | modified | +6 −6 |
| src/test/modules/test_json_parser/test_json_parser_incremental.c | modified | +14 −9 |
Discussion
- jsonapi: scary new warnings with LTO enabled 20 messages · 2025-04-16 → 2025-04-23