comparison src/userfunc.c @ 18572:23fef64352a1 v8.1.2280

patch 8.1.2280: crash when passing partial to substitute() Commit: https://github.com/vim/vim/commit/b0745b221d284e381f1bd4b591cd68ea54b6a51d Author: Bram Moolenaar <Bram@vim.org> Date: Sat Nov 9 22:28:11 2019 +0100 patch 8.1.2280: crash when passing partial to substitute() Problem: Crash when passing partial to substitute(). Solution: Take extra arguments into account. (closes https://github.com/vim/vim/issues/5186)
author Bram Moolenaar <Bram@vim.org>
date Sat, 09 Nov 2019 22:30:04 +0100
parents c0cd979000f9
children e9675870c480
comparison
equal deleted inserted replaced
18571:e268594d460a 18572:23fef64352a1
1586 if (fp != NULL && (fp->uf_flags & FC_DELETED)) 1586 if (fp != NULL && (fp->uf_flags & FC_DELETED))
1587 error = ERROR_DELETED; 1587 error = ERROR_DELETED;
1588 else if (fp != NULL) 1588 else if (fp != NULL)
1589 { 1589 {
1590 if (funcexe->argv_func != NULL) 1590 if (funcexe->argv_func != NULL)
1591 argcount = funcexe->argv_func(argcount, argvars, 1591 // postponed filling in the arguments, do it now
1592 argcount = funcexe->argv_func(argcount, argvars, argv_clear,
1592 fp->uf_args.ga_len); 1593 fp->uf_args.ga_len);
1593 1594
1594 if (funcexe->basetv != NULL) 1595 if (funcexe->basetv != NULL)
1595 { 1596 {
1596 // Method call: base->Method() 1597 // Method call: base->Method()