postgres.git / summary / log / commit / refs

commit    5b45f7ee7946dc2de9446ba1da71f839de369401
Author:   Andres Freund <andres@anarazel.de>
Date:     Tue Nov 04 23:36:18 2025 +0000
First released in: 13.23, 14.20, 15.15, 16.11, 17.7, 18.1

    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


src/backend/jit/llvm/llvmjit_expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c index f567356ed19..2e286adfb5b 100644 --- a/src/backend/jit/llvm/llvmjit_expr.c +++ b/src/backend/jit/llvm/llvmjit_expr.c @@ -2065,7 +2065,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] = [parent: bcfbd3f747d7]