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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui