To: vim_dev@googlegroups.com Subject: Patch 7.4.1656 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1656 Problem: Crash when using partial with a timer. Solution: Increment partial reference count. (Hirohito Higashi) Files: src/eval.c, src/testdir/test_timers.vim *** ../vim-7.4.1655/src/eval.c 2016-03-25 18:42:42.441280325 +0100 --- src/eval.c 2016-03-26 18:14:34.304753031 +0100 *************** *** 20190,20195 **** --- 20190,20196 ---- if (arg->v_type == VAR_PARTIAL && arg->vval.v_partial != NULL) { *pp = arg->vval.v_partial; + ++(*pp)->pt_refcount; return (*pp)->pt_name; } *pp = NULL; *** ../vim-7.4.1655/src/testdir/test_timers.vim 2016-03-15 23:10:26.412712095 +0100 --- src/testdir/test_timers.vim 2016-03-26 18:13:31.217396370 +0100 *************** *** 30,32 **** --- 30,45 ---- call assert_true(s:val > 1) call assert_true(s:val < 5) endfunc + + func Test_with_partial_callback() + let s:val = 0 + let s:meow = {} + function s:meow.bite(...) + let s:val += 1 + endfunction + + call timer_start(50, s:meow.bite) + sleep 200m + call assert_equal(1, s:val) + endfunc + " vim: ts=2 sw=0 et *** ../vim-7.4.1655/src/version.c 2016-03-25 19:02:57.096939431 +0100 --- src/version.c 2016-03-26 18:15:54.835931655 +0100 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1656, /**/ -- hundred-and-one symptoms of being an internet addict: 131. You challenge authority and society by portnuking people /// 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 ///