0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 7.4.1580

Problem:    Crash when using function reference. (Luchr)
Solution:   Set initial refcount. (Ken Takata, closes #690)
This commit is contained in:
Bram Moolenaar
2016-03-16 20:41:21 +01:00
parent a3dc5e92dc
commit 7a5c46a9df
3 changed files with 17 additions and 0 deletions

View File

@@ -21705,6 +21705,7 @@ handle_subscript(
/* Turn "dict.Func" into a partial for "Func" with "dict". */
if (pt != NULL)
{
pt->pt_refcount = 1;
pt->pt_dict = selfdict;
selfdict = NULL;
pt->pt_name = rettv->vval.v_string;

View File

@@ -68,3 +68,17 @@ func Test_partial_implicit()
call assert_fails('call function(dict.MyFunc, ["bbb"], dict)', 'E924:')
endfunc
fun InnerCall(funcref)
return a:funcref
endfu
fun OuterCall()
let opt = { 'func' : function('sin') }
call InnerCall(opt.func)
endfu
func Test_function_in_dict()
call OuterCall()
endfunc

View File

@@ -748,6 +748,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1580,
/**/
1579,
/**/