aboutsummaryrefslogtreecommitdiff
path: root/src/backend/jit/llvm/llvmjit_expr.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-11-03 15:55:23 -0700
committerAndres Freund <andres@anarazel.de>2018-11-03 16:00:00 -0700
commit6eb31cedb316d59bf9c63658868ff0fcddcc085a (patch)
tree8a868b1869cb8aa547179ca2129d98e95489903c /src/backend/jit/llvm/llvmjit_expr.c
parentfd59b29c873915064f7af6a33c968c97e0d59166 (diff)
downloadpostgresql-6eb31cedb316d59bf9c63658868ff0fcddcc085a.tar.gz
postgresql-6eb31cedb316d59bf9c63658868ff0fcddcc085a.zip
Prevent generating EEOP_AGG_STRICT_INPUT_CHECK operations when nargs == 0.
This only became a problem with 4c640f4f38, which didn't synchronize the value agg_strict_input_check.nargs is set to, with the guard condition for emitting the operation. Besides such instructions being unnecessary overhead, currently the LLVM JIT provider doesn't support them. It seems more sensible to avoid generating such instruction than supporting them. Add assertions to make it easier to debug a potential further occurance. Discussion: https://postgr.es/m/2a505161-2727-2473-7c46-591ed108ac52@email.cz Backpatch: 11-, like 4c640f4f38.
Diffstat (limited to 'src/backend/jit/llvm/llvmjit_expr.c')
-rw-r--r--src/backend/jit/llvm/llvmjit_expr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index 7454d05acaf..0da318218fd 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -2124,6 +2124,8 @@ llvm_compile_expr(ExprState *state)
LLVMValueRef v_nullp;
LLVMBasicBlockRef *b_checknulls;
+ Assert(nargs > 0);
+
jumpnull = op->d.agg_strict_input_check.jumpnull;
v_nullp = l_ptr_const(nulls, l_ptr(TypeStorageBool));