To: vim_dev@googlegroups.com Subject: Patch 7.4.1580 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1580 Problem: Crash when using function reference. (Luchr) Solution: Set initial refcount. (Ken Takata, closes #690) Files: src/eval.c, src/testdir/test_partial.vim *** ../vim-7.4.1579/src/eval.c 2016-03-15 23:10:26.404712179 +0100 --- src/eval.c 2016-03-16 20:38:51.030597660 +0100 *************** *** 21705,21710 **** --- 21705,21711 ---- /* 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; *** ../vim-7.4.1579/src/testdir/test_partial.vim 2016-03-15 19:33:30.057375668 +0100 --- src/testdir/test_partial.vim 2016-03-16 20:37:43.867293328 +0100 *************** *** 68,70 **** --- 68,84 ---- 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 + *** ../vim-7.4.1579/src/version.c 2016-03-15 23:19:10.499181350 +0100 --- src/version.c 2016-03-16 20:36:06.520301640 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1580, /**/ -- Keyboard not found. Think ENTER to continue. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///