]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix illegal attribute propagation in LLVM JIT.
authorThomas Munro <tmunro@postgresql.org>
Tue, 9 Apr 2024 22:46:15 +0000 (10:46 +1200)
committerThomas Munro <tmunro@postgresql.org>
Wed, 10 Apr 2024 00:15:07 +0000 (12:15 +1200)
commit7fe32eaa4a878500280ed7d33ce711c06b6939ff
tree19503b9c3d64fc1730897135e6e37a204a32c0e3
parent1435cc87d3a793a239d63bf7b20d35faba05f28f
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.stehule@gmail.com>
Reviewed-by: Dmitry Dolgov <9erthalion6@gmail.com>
Discussion: https://postgr.es/m/CAFj8pRACpVFr7LMdVYENUkScG5FCYMZDDdSGNU-tch%2Bw98OxYg%40mail.gmail.com
src/backend/jit/llvm/llvmjit.c