diff src/evalfunc.c @ 27589:ecea41486e8a v8.2.4321

patch 8.2.4321: Vim9: crash when using a funcref to a closure Commit: https://github.com/vim/vim/commit/92368aad613bca700877ccb1725e1cb5a80dd34a Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 7 17:50:39 2022 +0000 patch 8.2.4321: Vim9: crash when using a funcref to a closure Problem: Vim9: crash when using a funcref to a closure. Solution: Copy pt_outer to the new partial. (closes https://github.com/vim/vim/issues/9714)
author Bram Moolenaar <Bram@vim.org>
date Mon, 07 Feb 2022 19:00:03 +0100
parents 829aec0d0387
children d91be28bbdbb
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -4454,6 +4454,9 @@ common_function(typval_T *argvars, typva
 		    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;