pgsql: Fix illegal attribute propagation in LLVM JIT.

From: Thomas Munro <tmunro(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix illegal attribute propagation in LLVM JIT.
Date: 2024-04-10 00:27:35
Message-ID: E1ruLoN-001MVS-2C@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix illegal attribute propagation in LLVM JIT.

Commit 72559438 started copying more attributes from AttributeTemplate
to the functions we generate on the fly. In the case of deform
functions, which return void, this meant that "noundef", from
AttributeTemplate's return value (a Datum) was copied to a void type.
Older LLVM releases were OK with that, but LLVM 18 crashes.

Update our llvm_copy_attributes() function to skip copying the attribute
for the return value, if the target function returns void.

Thanks to Dmitry Dolgov for help chasing this down.

Back-patch to all supported releases, like 72559438.

Reported-by: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Reviewed-by: Dmitry Dolgov <9erthalion6(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAFj8pRACpVFr7LMdVYENUkScG5FCYMZDDdSGNU-tch%2Bw98OxYg%40mail.gmail.com

Branch
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/01b55203ace02bb02049cd147f63b407f3911ca5

Modified Files
--------------
src/backend/jit/llvm/llvmjit.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Kapila 2024-04-10 03:23:51 pgsql: Fix a test in failover slots regression test.
Previous Message Thomas Munro 2024-04-10 00:27:21 pgsql: Fix illegal attribute propagation in LLVM JIT.