From: Andres Freund Date: Tue, 4 Nov 2025 23:36:18 +0000 (-0500) Subject: jit: Fix accidentally-harmless type confusion X-Git-Tag: REL_13_23~13 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=7609b342c3bf74f93522061962a58add42185790;p=postgresql.git jit: Fix accidentally-harmless type confusion In 2a0faed9d702, which added JIT compilation support for expressions, I accidentally used sizeof(LLVMBasicBlockRef *) instead of sizeof(LLVMBasicBlockRef) as part of computing the size of an allocation. That turns out to have no real negative consequences due to LLVMBasicBlockRef being a pointer itself (and thus having the same size). It still is wrong and confusing, so fix it. Reported by coverity. Backpatch-through: 13 --- diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c index c0e7d036fba..1fe0904154d 100644 --- a/src/backend/jit/llvm/llvmjit_expr.c +++ b/src/backend/jit/llvm/llvmjit_expr.c @@ -2060,7 +2060,7 @@ llvm_compile_expr(ExprState *state) v_nullsp = l_ptr_const(nulls, l_ptr(TypeStorageBool)); /* create blocks for checking args */ - b_checknulls = palloc(sizeof(LLVMBasicBlockRef *) * nargs); + b_checknulls = palloc(sizeof(LLVMBasicBlockRef) * nargs); for (int argno = 0; argno < nargs; argno++) { b_checknulls[argno] =