Patch 8.1.1938
Problem:    May crash when out of memory.
Solution:   Initialize v_type to VAR_UNKNOWN. (Dominique Pelle, closes #4871)
Files:      src/userfunc.c


*** ../vim-8.1.1937/src/userfunc.c      2019-08-21 14:36:29.395376065 +0200
--- src/userfunc.c      2019-08-29 21:30:22.668793186 +0200
***************
*** 1501,1506 ****
--- 1501,1510 ----
      int               argv_base = 0;
      partial_T *partial = funcexe->partial;
  
+     // Initialize rettv so that it is safe for caller to invoke 
clear_tv(rettv)
+     // even when call_func() returns FAIL.
+     rettv->v_type = VAR_UNKNOWN;
+ 
      // Make a copy of the name, if it comes from a funcref variable it could
      // be changed or deleted in the called function.
      name = len > 0 ? vim_strnsave(funcname, len) : vim_strsave(funcname);
***************
*** 1530,1545 ****
        }
      }
  
!     /*
!      * Execute the function if executing and no errors were detected.
!      */
!     if (!funcexe->evaluate)
!     {
!       // Not evaluating, which means the return value is unknown.  This
!       // matters for giving error messages.
!       rettv->v_type = VAR_UNKNOWN;
!     }
!     else if (error == ERROR_NONE)
      {
        char_u *rfname = fname;
  
--- 1534,1540 ----
        }
      }
  
!     if (error == ERROR_NONE && funcexe->evaluate)
      {
        char_u *rfname = fname;
  
*** ../vim-8.1.1937/src/version.c       2019-08-29 21:24:17.494449998 +0200
--- src/version.c       2019-08-29 21:32:37.516161622 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     1938,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
132. You come back and check this list every half-hour.

 /// 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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/201908291933.x7TJXRQ3002416%40masaka.moolenaar.net.

Raspunde prin e-mail lui