summaryrefslogtreecommitdiff
path: root/src/evalfunc.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-02-07 17:50:39 +0000
committerBram Moolenaar <Bram@vim.org>2022-02-07 17:50:39 +0000
commit92368aad613bca700877ccb1725e1cb5a80dd34a (patch)
treee694fd1df97cf2cace8d2ccd2aab1c093ecdb41c /src/evalfunc.c
parent28f1a51bde36e2770dd54c9e2ae69a26cafa5a64 (diff)
downloadvim-git-92368aad613bca700877ccb1725e1cb5a80dd34a.tar.gz
patch 8.2.4321: Vim9: crash when using a funcref to a closurev8.2.4321
Problem: Vim9: crash when using a funcref to a closure. Solution: Copy pt_outer to the new partial. (closes #9714)
Diffstat (limited to 'src/evalfunc.c')
-rw-r--r--src/evalfunc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 3cc95c988..eb12e75d0 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4454,6 +4454,9 @@ common_function(typval_T *argvars, typval_T *rettv, int is_funcref)
pt->pt_name = name;
func_ref(name);
}
+
+ if (arg_pt != NULL)
+ pt->pt_outer = arg_pt->pt_outer;
}
rettv->v_type = VAR_PARTIAL;
rettv->vval.v_partial = pt;