-
Notifications
You must be signed in to change notification settings - Fork 67
/
Copy pathREL_11_STABLE-pg_pathman-core.diff
53 lines (48 loc) · 1.54 KB
/
REL_11_STABLE-pg_pathman-core.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
diff --git a/src/backend/jit/llvm/llvmjit_deform.c b/src/backend/jit/llvm/llvmjit_deform.c
index 6384ac940d8..8b4f731e7a8 100644
--- a/src/backend/jit/llvm/llvmjit_deform.c
+++ b/src/backend/jit/llvm/llvmjit_deform.c
@@ -104,6 +104,10 @@ slot_compile_deform(LLVMJitContext *context, TupleDesc desc, int natts)
int attnum;
+ /* don't generate code for tuples without user attributes */
+ if (desc->natts == 0)
+ return NULL;
+
mod = llvm_mutable_module(context);
funcname = llvm_expand_funcname(context, "deform");
diff --git a/src/backend/jit/llvm/llvmjit_expr.c b/src/backend/jit/llvm/llvmjit_expr.c
index 12138e49577..8638ebc4ba1 100644
--- a/src/backend/jit/llvm/llvmjit_expr.c
+++ b/src/backend/jit/llvm/llvmjit_expr.c
@@ -274,6 +274,7 @@ llvm_compile_expr(ExprState *state)
LLVMValueRef v_slot;
LLVMBasicBlockRef b_fetch;
LLVMValueRef v_nvalid;
+ LLVMValueRef l_jit_deform = NULL;
b_fetch = l_bb_before_v(opblocks[i + 1],
"op.%d.fetch", i);
@@ -336,17 +337,20 @@ llvm_compile_expr(ExprState *state)
*/
if (desc && (context->base.flags & PGJIT_DEFORM))
{
- LLVMValueRef params[1];
- LLVMValueRef l_jit_deform;
-
l_jit_deform =
- slot_compile_deform(context, desc,
+ slot_compile_deform(context,
+ desc,
op->d.fetch.last_var);
+ }
+
+ if (l_jit_deform)
+ {
+ LLVMValueRef params[1];
+
params[0] = v_slot;
LLVMBuildCall(b, l_jit_deform,
params, lengthof(params), "");
-
}
else
{