Mercurial > vim
comparison src/eval.c @ 8581:fd454847836d v7.4.1580
commit https://github.com/vim/vim/commit/7a5c46a9df7ef01a4f6a620861c35400d5ad28d9
Author: Bram Moolenaar <Bram@vim.org>
Date: Wed Mar 16 20:41:21 2016 +0100
patch 7.4.1580
Problem: Crash when using function reference. (Luchr)
Solution: Set initial refcount. (Ken Takata, closes https://github.com/vim/vim/issues/690)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 16 Mar 2016 20:45:05 +0100 |
parents | 63dc856bd13d |
children | 537bbbd4e987 |
comparison
equal
deleted
inserted
replaced
8580:594b539a8feb | 8581:fd454847836d |
---|---|
21703 partial_T *pt = (partial_T *)alloc_clear(sizeof(partial_T)); | 21703 partial_T *pt = (partial_T *)alloc_clear(sizeof(partial_T)); |
21704 | 21704 |
21705 /* Turn "dict.Func" into a partial for "Func" with "dict". */ | 21705 /* Turn "dict.Func" into a partial for "Func" with "dict". */ |
21706 if (pt != NULL) | 21706 if (pt != NULL) |
21707 { | 21707 { |
21708 pt->pt_refcount = 1; | |
21708 pt->pt_dict = selfdict; | 21709 pt->pt_dict = selfdict; |
21709 selfdict = NULL; | 21710 selfdict = NULL; |
21710 pt->pt_name = rettv->vval.v_string; | 21711 pt->pt_name = rettv->vval.v_string; |
21711 func_ref(pt->pt_name); | 21712 func_ref(pt->pt_name); |
21712 rettv->v_type = VAR_PARTIAL; | 21713 rettv->v_type = VAR_PARTIAL; |