diff options
author | Daniel Gustafsson <dgustafsson@postgresql.org> | 2023-12-11 12:02:01 +0100 |
---|---|---|
committer | Daniel Gustafsson <dgustafsson@postgresql.org> | 2023-12-11 12:02:01 +0100 |
commit | c922b241064ceadc95c49fac445e4ed24171b3f0 (patch) | |
tree | c554894e7f5f956de603ef51b389a28d8b2a5d76 /src/backend/jit/llvm/llvmjit_expr.c | |
parent | e81e617f3273b74c8eb46f7a7c51387509bc8d8c (diff) | |
download | postgresql-c922b241064ceadc95c49fac445e4ed24171b3f0.tar.gz postgresql-c922b241064ceadc95c49fac445e4ed24171b3f0.zip |
jit: Create void type in the right context
Commit 3b991f81c45 introduced a specific context for types such
that all no longer referenced types can be dropped periodically
rather than leaking. One void pointer type creation was however
missed leading to an assertion failure in LLVM Debug builds.
Per buildfarm members canebreak and urutu. Fix with assistance
from Andres. The codepath in question was refactored in version
13 hence why this only affected version 12.
Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/1106876.1700409912@sss.pgh.pa.us
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_expr.c')
-rw-r--r-- | src/backend/jit/llvm/llvmjit_expr.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c index c25960a82bb..f2cf2fadaa6 100644 --- a/src/backend/jit/llvm/llvmjit_expr.c +++ b/src/backend/jit/llvm/llvmjit_expr.c @@ -2620,7 +2620,9 @@ build_EvalXFunc(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, LLVMValueRef v_fn; LLVMTypeRef param_types[3]; LLVMValueRef params[3]; + LLVMContextRef lc; + lc = LLVMGetModuleContext(mod); v_fn = LLVMGetNamedFunction(mod, funcname); if (!v_fn) { @@ -2628,7 +2630,7 @@ build_EvalXFunc(LLVMBuilderRef b, LLVMModuleRef mod, const char *funcname, param_types[1] = l_ptr(StructExprEvalStep); param_types[2] = l_ptr(StructExprContext); - sig = LLVMFunctionType(LLVMVoidType(), + sig = LLVMFunctionType(LLVMVoidTypeInContext(lc), param_types, lengthof(param_types), false); v_fn = LLVMAddFunction(mod, funcname, sig); |