aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2018-07-22 20:31:22 -0700
committerAndres Freund <andres@anarazel.de>2018-07-22 20:34:57 -0700
commit0171ad9308ac232d5934d548a2adc898b794c5e0 (patch)
tree069d46c619d8ade6aaf0e4d2a4da470bfb8428dc
parenta9a0a4d3f88b87564533b87af64d3282ca417dc6 (diff)
downloadpostgresql-0171ad9308ac232d5934d548a2adc898b794c5e0.tar.gz
postgresql-0171ad9308ac232d5934d548a2adc898b794c5e0.zip
Reset context at the tail end of JITed EEOP_AGG_PLAIN_TRANS.
While no negative consequences are currently known, it's clearly wrong to not reset the context in one of the branches. Reported-By: Dmitry Dolgov Author: Dmitry Dolgov Discussion: https://postgr.es/m/CAGPqQf165-=+Drw3Voim7M5EjHT1zwPF9BQRjLFQzCzYnNZEiQ@mail.gmail.com Backpatch: 11-, where JIT compilation support was added
-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 31b03212751..0f3109334e8 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -2499,6 +2499,8 @@ llvm_compile_expr(ExprState *state)
/* store trans value */
LLVMBuildStore(b, v_newval, v_transvaluep);
LLVMBuildStore(b, v_fcinfo_isnull, v_transnullp);
+
+ l_mcxt_switch(mod, b, v_oldcontext);
LLVMBuildBr(b, opblocks[i + 1]);
/* returned datum passed datum, no need to reparent */