Skip to content

Commit 2d83d72

Browse files
committed
jit: Fix accidentally-harmless type confusion
In 2a0faed, 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
1 parent d115de9 commit 2d83d72

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/jit/llvm/llvmjit_expr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2505,7 +2505,7 @@ llvm_compile_expr(ExprState *state)
25052505
v_nullsp = l_ptr_const(nulls, l_ptr(TypeStorageBool));
25062506

25072507
/* create blocks for checking args */
2508-
b_checknulls = palloc(sizeof(LLVMBasicBlockRef *) * nargs);
2508+
b_checknulls = palloc(sizeof(LLVMBasicBlockRef) * nargs);
25092509
for (int argno = 0; argno < nargs; argno++)
25102510
{
25112511
b_checknulls[argno] =

0 commit comments

Comments
 (0)