Skip to content

Commit 7609b34

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 ef81697 commit 7609b34

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
@@ -2060,7 +2060,7 @@ llvm_compile_expr(ExprState *state)
20602060
v_nullsp = l_ptr_const(nulls, l_ptr(TypeStorageBool));
20612061

20622062
/* create blocks for checking args */
2063-
b_checknulls = palloc(sizeof(LLVMBasicBlockRef *) * nargs);
2063+
b_checknulls = palloc(sizeof(LLVMBasicBlockRef) * nargs);
20642064
for (int argno = 0; argno < nargs; argno++)
20652065
{
20662066
b_checknulls[argno] =

0 commit comments

Comments
 (0)