Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit53c8d6c

Browse files
committed
Fix illegal attribute propagation in LLVM JIT.
Commit7255943 started copying more attributes from AttributeTemplateto the functions we generate on the fly. In the case of deformfunctions, which return void, this meant that "noundef", fromAttributeTemplate'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 attributefor the return value, if the target function returns void.Thanks to Dmitry Dolgov for help chasing this down.Back-patch to all supported releases, like7255943.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
1 parent8461424 commit53c8d6c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/jit/llvm/llvmjit.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,11 @@ llvm_copy_attributes(LLVMValueRef v_from, LLVMValueRef v_to)
552552
/* copy function attributes */
553553
llvm_copy_attributes_at_index(v_from,v_to,LLVMAttributeFunctionIndex);
554554

555-
/* and the return value attributes */
556-
llvm_copy_attributes_at_index(v_from,v_to,LLVMAttributeReturnIndex);
555+
if (LLVMGetTypeKind(LLVMGetFunctionReturnType(v_to))!=LLVMVoidTypeKind)
556+
{
557+
/* and the return value attributes */
558+
llvm_copy_attributes_at_index(v_from,v_to,LLVMAttributeReturnIndex);
559+
}
557560

558561
/* and each function parameter's attribute */
559562
param_count=LLVMCountParams(v_from);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp