From dbb386e1b277004e37902fd1c794727277312765 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Wed, 18 Mar 2020 00:47:46 -0400 Subject: vim-patch:8.1.2280: crash when passing partial to substitute() Problem: Crash when passing partial to substitute(). Solution: Take extra arguments into account. (closes vim/vim#5186) https://github.com/vim/vim/commit/b0745b221d284e381f1bd4b591cd68ea54b6a51d --- src/nvim/eval.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index dc20940166..7c7e9da8ac 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -6382,7 +6382,9 @@ call_func( error = ERROR_DELETED; } else if (fp != NULL) { if (argv_func != NULL) { - argcount = argv_func(argcount, argvars, fp->uf_args.ga_len); + // postponed filling in the arguments, do it now + argcount = argv_func(argcount, argvars, argv_clear, + fp->uf_args.ga_len); } if (fp->uf_flags & FC_RANGE) { *doesrange = true; -- cgit